<!DOCTYPE html>
<html lang="en-US">
<!-- SECTION: Programming -->
<head>
<title>CUPS Programming Manual</title>
<meta name="keywords" content="Programming">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="generator" content="codedoc v3.7">
<meta name="author" content="Michael R Sweet">
<meta name="language" content="en-US">
<meta name="copyright" content="Copyright © 2021-2024 by OpenPrinting. All Rights Reserved.">
<meta name="version" content="3.0.0">
<style type="text/css"><!--
body {
  background: white;
  color: black;
  font-family: sans-serif;
  font-size: 12pt;
}
a {
  color: black;
}
a:link, a:visited {
  color: #00f;
}
a:link:hover, a:visited:hover, a:active {
  color: #c0c;
}
body, p, h1, h2, h3, h4, h5, h6 {
  font-family: sans-serif;
  line-height: 1.4;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  page-break-inside: avoid;
}
h1 {
  font-size: 250%;
  margin: 0;
}
h2 {
  font-size: 250%;
  margin-top: 1.5em;
}
h3 {
  font-size: 200%;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
}
h4 {
  font-size: 150%;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
}
h5 {
  font-size: 125%;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
}
h6 {
  font-size: 110%;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
}
img.title {
  width: 256px;
}
div.header h1, div.header p {
  text-align: center;
}
div.contents, div.body, div.footer {
  page-break-before: always;
}
.class, .enumeration, .function, .struct, .typedef, .union {
  border-bottom: solid 2px gray;
}
.description {
  margin-top: 0.5em;
}
.function {
  margin-bottom: 0;
}
blockquote {
  border: solid thin gray;
  box-shadow: 3px 3px 5px rgba(127,127,127,0.25);
  margin: 1em 0;
  padding: 10px;
  page-break-inside: avoid;
}
blockquote :first-child {
  margin-top: 0;
}
blockquote :first-child {
  margin-bottom: 0;
}
p code, li code, p.code, pre, ul.code li {
  font-family: monospace;
  hyphens: manual;
  -webkit-hyphens: manual;
}
p.code, pre, ul.code li {
  background: rgba(127,127,127,0.25);
  border: thin dotted gray;
  padding: 10px;
  page-break-inside: avoid;
}
pre {
  white-space: pre-wrap;
}
a:link, a:visited {
  text-decoration: none;
}
span.info {
  background: black;
  border: solid thin black;
  color: white;
  font-size: 80%;
  font-style: italic;
  font-weight: bold;
  white-space: nowrap;
}
h1 span.info, h2 span.info, h3 span.info, h4 span.info {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  float: right;
  padding: 3px 6px;
}
ul.code, ul.contents, ul.subcontents {
  list-style-type: none;
  margin: 0;
  padding-left: 0;
}
ul.code li {
  margin: 0;
}
ul.contents > li {
  margin-top: 1em;
}
ul.contents li ul.code, ul.contents li ul.subcontents {
  padding-left: 2em;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
td {
  border: solid 1px gray;
  padding: 5px 10px;
  vertical-align: top;
}
td.left {
  text-align: left;
}
td.center {
  text-align: center;
}
td.right {
  text-align: right;
}
th {
  border-bottom: solid 2px gray;
  padding: 1px 5px;
  text-align: center;
  vertical-align: bottom;
}
tr:nth-child(even) {
  background: rgba(127,127,127,0.25);
}
table.list {
  border-collapse: collapse;
  width: 100%;
}
table.list th {
  border-bottom: none;
  border-right: 2px solid gray;
  font-family: monospace;
  font-weight: normal;
  padding: 5px 10px 5px 2px;
  text-align: right;
  vertical-align: top;
}
table.list td {
  border: none;
  padding: 5px 2px 5px 10px;
  text-align: left;
  vertical-align: top;
}
h2.title, h3.title {
  border-bottom: solid 2px gray;
}
/* Syntax highlighting */
span.comment {
  color: darkgreen;
}
span.directive {
  color: red;
}
span.number {
  color: brown;
}
span.reserved {
  color: blue;
}
span.string {
  color: magenta;
}
/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  body {
    background: black;
    color: #ccc;
  }
  a {
    color: #ccc;
  }
  a:link, a:visited {
    color: #66f;
  }
  a:link:hover, a:visited:hover, a:active {
    color: #f06;
  }
}
/* Show contents on left side in web browser */
@media screen and (min-width: 800px) {
  div.contents {
    border-right: solid thin gray;
    bottom: 0px;
    box-shadow: 3px 3px 5px rgba(127,127,127,0.5);
    font-size: 10pt;
    left: 0px;
    overflow: scroll;
    padding: 1%;
    position: fixed;
    top: 0px;
    width: 18%;
  }
  div.contents h2.title {
    margin-top: 0px;
  }
  div.header, div.body, div.footer {
    margin-left: 20%;
    padding: 1% 2%;
  }
}
/* Center title page content vertically */
@media print {
  div.header {
    padding-top: 33%;
  }
}
--></style>
</head>
<body>
<div class="header">
<h1 class="title">CUPS Programming Manual</h1>
<p>Michael R Sweet</p>
<p>Copyright © 2021-2024 by OpenPrinting. All Rights Reserved.</p>
</div>
<div class="contents">
<h2 class="title">Contents</h2>
<ul class="contents">
<li><a href="#introduction">Introduction</a><ul class="subcontents">
<li><a href="#guidelines">Guidelines</a></li>
<li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
<li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
</ul></li>
<li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
<li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
<li><a href="#basic-destination-information">Basic Destination Information</a></li>
<li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
<li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
</ul></li>
<li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
<li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
<li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
<li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
<li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
<li><a href="#authentication">Authentication</a></li>
</ul></li>
<li><a href="#ipp-data-file-api">IPP Data File API</a><ul class="subcontents">
<li><a href="#creating-an-ipp-data-file">Creating an IPP Data File</a></li>
<li><a href="#reading-a-data-file">Reading a Data File</a></li>
<li><a href="#variables">Variables</a></li>
<li><a href="#writing-ipp-data-files">Writing IPP Data Files</a></li>
</ul></li>
<li><a href="#migrating-code-from-cups-2.x-and-earlier">Migrating Code from CUPS 2.x and Earlier</a><ul class="subcontents">
<li><a href="#general-changes">General Changes</a></li>
<li><a href="#specific-api-changes">Specific API Changes</a></li>
<li><a href="#removed-functions-and-types">Removed Functions and Types</a></li>
<li><a href="#renamed-functions-and-types">Renamed Functions and Types</a></li>
</ul></li>
<li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
<li><a href="#cupsAddDest">cupsAddDest</a></li>
<li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li>
<li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
<li><a href="#cupsAddOption">cupsAddOption</a></li>
<li><a href="#cupsAreCredentialsValidForName">cupsAreCredentialsValidForName</a></li>
<li><a href="#cupsArrayAdd">cupsArrayAdd</a></li>
<li><a href="#cupsArrayAddStrings">cupsArrayAddStrings</a></li>
<li><a href="#cupsArrayClear">cupsArrayClear</a></li>
<li><a href="#cupsArrayDelete">cupsArrayDelete</a></li>
<li><a href="#cupsArrayDup">cupsArrayDup</a></li>
<li><a href="#cupsArrayFind">cupsArrayFind</a></li>
<li><a href="#cupsArrayGetCount">cupsArrayGetCount</a></li>
<li><a href="#cupsArrayGetCurrent">cupsArrayGetCurrent</a></li>
<li><a href="#cupsArrayGetElement">cupsArrayGetElement</a></li>
<li><a href="#cupsArrayGetFirst">cupsArrayGetFirst</a></li>
<li><a href="#cupsArrayGetIndex">cupsArrayGetIndex</a></li>
<li><a href="#cupsArrayGetInsert">cupsArrayGetInsert</a></li>
<li><a href="#cupsArrayGetLast">cupsArrayGetLast</a></li>
<li><a href="#cupsArrayGetNext">cupsArrayGetNext</a></li>
<li><a href="#cupsArrayGetPrev">cupsArrayGetPrev</a></li>
<li><a href="#cupsArrayGetUserData">cupsArrayGetUserData</a></li>
<li><a href="#cupsArrayInsert">cupsArrayInsert</a></li>
<li><a href="#cupsArrayNew">cupsArrayNew</a></li>
<li><a href="#cupsArrayNewStrings">cupsArrayNewStrings</a></li>
<li><a href="#cupsArrayRemove">cupsArrayRemove</a></li>
<li><a href="#cupsArrayRestore">cupsArrayRestore</a></li>
<li><a href="#cupsArraySave">cupsArraySave</a></li>
<li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
<li><a href="#cupsCharsetToUTF8">cupsCharsetToUTF8</a></li>
<li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
<li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
<li><a href="#cupsConcatString">cupsConcatString</a></li>
<li><a href="#cupsCondBroadcast">cupsCondBroadcast</a></li>
<li><a href="#cupsCondDestroy">cupsCondDestroy</a></li>
<li><a href="#cupsCondInit">cupsCondInit</a></li>
<li><a href="#cupsCondWait">cupsCondWait</a></li>
<li><a href="#cupsConnectDest">cupsConnectDest</a></li>
<li><a href="#cupsCopyCredentials">cupsCopyCredentials</a></li>
<li><a href="#cupsCopyCredentialsKey">cupsCopyCredentialsKey</a></li>
<li><a href="#cupsCopyCredentialsRequest">cupsCopyCredentialsRequest</a></li>
<li><a href="#cupsCopyDest">cupsCopyDest</a></li>
<li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
<li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
<li><a href="#cupsCopyString">cupsCopyString</a></li>
<li><a href="#cupsCreateCredentials">cupsCreateCredentials</a></li>
<li><a href="#cupsCreateCredentialsRequest">cupsCreateCredentialsRequest</a></li>
<li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
<li><a href="#cupsCreateTempFd">cupsCreateTempFd</a></li>
<li><a href="#cupsCreateTempFile">cupsCreateTempFile</a></li>
<li><a href="#cupsDNSSDAssembleFullName">cupsDNSSDAssembleFullName</a></li>
<li><a href="#cupsDNSSDBrowseDelete">cupsDNSSDBrowseDelete</a></li>
<li><a href="#cupsDNSSDBrowseGetContext">cupsDNSSDBrowseGetContext</a></li>
<li><a href="#cupsDNSSDBrowseNew">cupsDNSSDBrowseNew</a></li>
<li><a href="#cupsDNSSDCopyComputerName">cupsDNSSDCopyComputerName</a></li>
<li><a href="#cupsDNSSDCopyHostName">cupsDNSSDCopyHostName</a></li>
<li><a href="#cupsDNSSDDecodeTXT">cupsDNSSDDecodeTXT</a></li>
<li><a href="#cupsDNSSDDelete">cupsDNSSDDelete</a></li>
<li><a href="#cupsDNSSDGetConfigChanges">cupsDNSSDGetConfigChanges</a></li>
<li><a href="#cupsDNSSDNew">cupsDNSSDNew</a></li>
<li><a href="#cupsDNSSDQueryDelete">cupsDNSSDQueryDelete</a></li>
<li><a href="#cupsDNSSDQueryGetContext">cupsDNSSDQueryGetContext</a></li>
<li><a href="#cupsDNSSDQueryNew">cupsDNSSDQueryNew</a></li>
<li><a href="#cupsDNSSDResolveDelete">cupsDNSSDResolveDelete</a></li>
<li><a href="#cupsDNSSDResolveGetContext">cupsDNSSDResolveGetContext</a></li>
<li><a href="#cupsDNSSDResolveNew">cupsDNSSDResolveNew</a></li>
<li><a href="#cupsDNSSDSeparateFullName">cupsDNSSDSeparateFullName</a></li>
<li><a href="#cupsDNSSDServiceAdd">cupsDNSSDServiceAdd</a></li>
<li><a href="#cupsDNSSDServiceDelete">cupsDNSSDServiceDelete</a></li>
<li><a href="#cupsDNSSDServiceGetContext">cupsDNSSDServiceGetContext</a></li>
<li><a href="#cupsDNSSDServiceGetName">cupsDNSSDServiceGetName</a></li>
<li><a href="#cupsDNSSDServiceNew">cupsDNSSDServiceNew</a></li>
<li><a href="#cupsDNSSDServicePublish">cupsDNSSDServicePublish</a></li>
<li><a href="#cupsDNSSDServiceSetLocation">cupsDNSSDServiceSetLocation</a></li>
<li><a href="#cupsDirClose">cupsDirClose</a></li>
<li><a href="#cupsDirOpen">cupsDirOpen</a></li>
<li><a href="#cupsDirRead">cupsDirRead</a></li>
<li><a href="#cupsDirRewind">cupsDirRewind</a></li>
<li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
<li><a href="#cupsDoFileRequest">cupsDoFileRequest</a></li>
<li><a href="#cupsDoIORequest">cupsDoIORequest</a></li>
<li><a href="#cupsDoRequest">cupsDoRequest</a></li>
<li><a href="#cupsEncodeOption">cupsEncodeOption</a></li>
<li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
<li><a href="#cupsEncodingString">cupsEncodingString</a></li>
<li><a href="#cupsEncodingValue">cupsEncodingValue</a></li>
<li><a href="#cupsEnumDests">cupsEnumDests</a></li>
<li><a href="#cupsFileClose">cupsFileClose</a></li>
<li><a href="#cupsFileEOF">cupsFileEOF</a></li>
<li><a href="#cupsFileFind">cupsFileFind</a></li>
<li><a href="#cupsFileFlush">cupsFileFlush</a></li>
<li><a href="#cupsFileGetChar">cupsFileGetChar</a></li>
<li><a href="#cupsFileGetConf">cupsFileGetConf</a></li>
<li><a href="#cupsFileGetLine">cupsFileGetLine</a></li>
<li><a href="#cupsFileGets">cupsFileGets</a></li>
<li><a href="#cupsFileIsCompressed">cupsFileIsCompressed</a></li>
<li><a href="#cupsFileLock">cupsFileLock</a></li>
<li><a href="#cupsFileNumber">cupsFileNumber</a></li>
<li><a href="#cupsFileOpen">cupsFileOpen</a></li>
<li><a href="#cupsFileOpenFd">cupsFileOpenFd</a></li>
<li><a href="#cupsFilePeekChar">cupsFilePeekChar</a></li>
<li><a href="#cupsFilePrintf">cupsFilePrintf</a></li>
<li><a href="#cupsFilePutChar">cupsFilePutChar</a></li>
<li><a href="#cupsFilePutConf">cupsFilePutConf</a></li>
<li><a href="#cupsFilePuts">cupsFilePuts</a></li>
<li><a href="#cupsFileRead">cupsFileRead</a></li>
<li><a href="#cupsFileRewind">cupsFileRewind</a></li>
<li><a href="#cupsFileSeek">cupsFileSeek</a></li>
<li><a href="#cupsFileStderr">cupsFileStderr</a></li>
<li><a href="#cupsFileStdin">cupsFileStdin</a></li>
<li><a href="#cupsFileStdout">cupsFileStdout</a></li>
<li><a href="#cupsFileTell">cupsFileTell</a></li>
<li><a href="#cupsFileUnlock">cupsFileUnlock</a></li>
<li><a href="#cupsFileWrite">cupsFileWrite</a></li>
<li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
<li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
<li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
<li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
<li><a href="#cupsFormDecode">cupsFormDecode</a></li>
<li><a href="#cupsFormEncode">cupsFormEncode</a></li>
<li><a href="#cupsFormatString">cupsFormatString</a></li>
<li><a href="#cupsFormatStringv">cupsFormatStringv</a></li>
<li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
<li><a href="#cupsFreeDests">cupsFreeDests</a></li>
<li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
<li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
<li><a href="#cupsGetCredentialsExpiration">cupsGetCredentialsExpiration</a></li>
<li><a href="#cupsGetCredentialsInfo">cupsGetCredentialsInfo</a></li>
<li><a href="#cupsGetCredentialsTrust">cupsGetCredentialsTrust</a></li>
<li><a href="#cupsGetDefault">cupsGetDefault</a></li>
<li><a href="#cupsGetDest">cupsGetDest</a></li>
<li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
<li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
<li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
<li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
<li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
<li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
<li><a href="#cupsGetDests">cupsGetDests</a></li>
<li><a href="#cupsGetEncryption">cupsGetEncryption</a></li>
<li><a href="#cupsGetError">cupsGetError</a></li>
<li><a href="#cupsGetErrorString">cupsGetErrorString</a></li>
<li><a href="#cupsGetFd">cupsGetFd</a></li>
<li><a href="#cupsGetFile">cupsGetFile</a></li>
<li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
<li><a href="#cupsGetJobs">cupsGetJobs</a></li>
<li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
<li><a href="#cupsGetOption">cupsGetOption</a></li>
<li><a href="#cupsGetPassword">cupsGetPassword</a></li>
<li><a href="#cupsGetRand">cupsGetRand</a></li>
<li><a href="#cupsGetResponse">cupsGetResponse</a></li>
<li><a href="#cupsGetServer">cupsGetServer</a></li>
<li><a href="#cupsGetUser">cupsGetUser</a></li>
<li><a href="#cupsGetUserAgent">cupsGetUserAgent</a></li>
<li><a href="#cupsHMACData">cupsHMACData</a></li>
<li><a href="#cupsHashData">cupsHashData</a></li>
<li><a href="#cupsHashString">cupsHashString</a></li>
<li><a href="#cupsJSONAdd">cupsJSONAdd</a></li>
<li><a href="#cupsJSONDelete">cupsJSONDelete</a></li>
<li><a href="#cupsJSONExportFile">cupsJSONExportFile</a></li>
<li><a href="#cupsJSONExportString">cupsJSONExportString</a></li>
<li><a href="#cupsJSONFind">cupsJSONFind</a></li>
<li><a href="#cupsJSONGetChild">cupsJSONGetChild</a></li>
<li><a href="#cupsJSONGetCount">cupsJSONGetCount</a></li>
<li><a href="#cupsJSONGetKey">cupsJSONGetKey</a></li>
<li><a href="#cupsJSONGetNumber">cupsJSONGetNumber</a></li>
<li><a href="#cupsJSONGetParent">cupsJSONGetParent</a></li>
<li><a href="#cupsJSONGetSibling">cupsJSONGetSibling</a></li>
<li><a href="#cupsJSONGetString">cupsJSONGetString</a></li>
<li><a href="#cupsJSONGetType">cupsJSONGetType</a></li>
<li><a href="#cupsJSONImportFile">cupsJSONImportFile</a></li>
<li><a href="#cupsJSONImportString">cupsJSONImportString</a></li>
<li><a href="#cupsJSONImportURL">cupsJSONImportURL</a></li>
<li><a href="#cupsJSONNew">cupsJSONNew</a></li>
<li><a href="#cupsJSONNewKey">cupsJSONNewKey</a></li>
<li><a href="#cupsJSONNewNumber">cupsJSONNewNumber</a></li>
<li><a href="#cupsJSONNewString">cupsJSONNewString</a></li>
<li><a href="#cupsJWTDelete">cupsJWTDelete</a></li>
<li><a href="#cupsJWTExportString">cupsJWTExportString</a></li>
<li><a href="#cupsJWTGetAlgorithm">cupsJWTGetAlgorithm</a></li>
<li><a href="#cupsJWTGetClaimNumber">cupsJWTGetClaimNumber</a></li>
<li><a href="#cupsJWTGetClaimString">cupsJWTGetClaimString</a></li>
<li><a href="#cupsJWTGetClaimType">cupsJWTGetClaimType</a></li>
<li><a href="#cupsJWTGetClaimValue">cupsJWTGetClaimValue</a></li>
<li><a href="#cupsJWTGetClaims">cupsJWTGetClaims</a></li>
<li><a href="#cupsJWTGetHeaderNumber">cupsJWTGetHeaderNumber</a></li>
<li><a href="#cupsJWTGetHeaderString">cupsJWTGetHeaderString</a></li>
<li><a href="#cupsJWTGetHeaderType">cupsJWTGetHeaderType</a></li>
<li><a href="#cupsJWTGetHeaderValue">cupsJWTGetHeaderValue</a></li>
<li><a href="#cupsJWTGetHeaders">cupsJWTGetHeaders</a></li>
<li><a href="#cupsJWTHasValidSignature">cupsJWTHasValidSignature</a></li>
<li><a href="#cupsJWTImportString">cupsJWTImportString</a></li>
<li><a href="#cupsJWTMakePrivateKey">cupsJWTMakePrivateKey</a></li>
<li><a href="#cupsJWTMakePublicKey">cupsJWTMakePublicKey</a></li>
<li><a href="#cupsJWTNew">cupsJWTNew</a></li>
<li><a href="#cupsJWTSetClaimNumber">cupsJWTSetClaimNumber</a></li>
<li><a href="#cupsJWTSetClaimString">cupsJWTSetClaimString</a></li>
<li><a href="#cupsJWTSetClaimValue">cupsJWTSetClaimValue</a></li>
<li><a href="#cupsJWTSetHeaderNumber">cupsJWTSetHeaderNumber</a></li>
<li><a href="#cupsJWTSetHeaderString">cupsJWTSetHeaderString</a></li>
<li><a href="#cupsJWTSetHeaderValue">cupsJWTSetHeaderValue</a></li>
<li><a href="#cupsJWTSign">cupsJWTSign</a></li>
<li><a href="#cupsLangAddStrings">cupsLangAddStrings</a></li>
<li><a href="#cupsLangDefault">cupsLangDefault</a></li>
<li><a href="#cupsLangFind">cupsLangFind</a></li>
<li><a href="#cupsLangFormatString">cupsLangFormatString</a></li>
<li><a href="#cupsLangGetEncoding">cupsLangGetEncoding</a></li>
<li><a href="#cupsLangGetName">cupsLangGetName</a></li>
<li><a href="#cupsLangGetString">cupsLangGetString</a></li>
<li><a href="#cupsLangLoadStrings">cupsLangLoadStrings</a></li>
<li><a href="#cupsLangPrintf">cupsLangPrintf</a></li>
<li><a href="#cupsLangPuts">cupsLangPuts</a></li>
<li><a href="#cupsLangSetDirectory">cupsLangSetDirectory</a></li>
<li><a href="#cupsLangSetLocale">cupsLangSetLocale</a></li>
<li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
<li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
<li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
<li><a href="#cupsLocalizeNotifySubject">cupsLocalizeNotifySubject</a></li>
<li><a href="#cupsLocalizeNotifyText">cupsLocalizeNotifyText</a></li>
<li><a href="#cupsMutexDestroy">cupsMutexDestroy</a></li>
<li><a href="#cupsMutexInit">cupsMutexInit</a></li>
<li><a href="#cupsMutexLock">cupsMutexLock</a></li>
<li><a href="#cupsMutexUnlock">cupsMutexUnlock</a></li>
<li><a href="#cupsOAuthClearTokens">cupsOAuthClearTokens</a></li>
<li><a href="#cupsOAuthCopyAccessToken">cupsOAuthCopyAccessToken</a></li>
<li><a href="#cupsOAuthCopyClientId">cupsOAuthCopyClientId</a></li>
<li><a href="#cupsOAuthCopyId">cupsOAuthCopyId</a></li>
<li><a href="#cupsOAuthCopyRefreshToken">cupsOAuthCopyRefreshToken</a></li>
<li><a href="#cupsOAuthGetAuthorizationCode">cupsOAuthGetAuthorizationCode</a></li>
<li><a href="#cupsOAuthGetClientId">cupsOAuthGetClientId</a></li>
<li><a href="#cupsOAuthGetMetadata">cupsOAuthGetMetadata</a></li>
<li><a href="#cupsOAuthGetTokens">cupsOAuthGetTokens</a></li>
<li><a href="#cupsOAuthMakeAuthorizationURL">cupsOAuthMakeAuthorizationURL</a></li>
<li><a href="#cupsOAuthMakeBase64Random">cupsOAuthMakeBase64Random</a></li>
<li><a href="#cupsOAuthSetClientId">cupsOAuthSetClientId</a></li>
<li><a href="#cupsOAuthSetTokens">cupsOAuthSetTokens</a></li>
<li><a href="#cupsParseOptions">cupsParseOptions</a></li>
<li><a href="#cupsPutFd">cupsPutFd</a></li>
<li><a href="#cupsPutFile">cupsPutFile</a></li>
<li><a href="#cupsRWDestroy">cupsRWDestroy</a></li>
<li><a href="#cupsRWInit">cupsRWInit</a></li>
<li><a href="#cupsRWLockRead">cupsRWLockRead</a></li>
<li><a href="#cupsRWLockWrite">cupsRWLockWrite</a></li>
<li><a href="#cupsRWUnlock">cupsRWUnlock</a></li>
<li><a href="#cupsRasterClose">cupsRasterClose</a></li>
<li><a href="#cupsRasterGetErrorString">cupsRasterGetErrorString</a></li>
<li><a href="#cupsRasterInitHeader">cupsRasterInitHeader</a></li>
<li><a href="#cupsRasterOpen">cupsRasterOpen</a></li>
<li><a href="#cupsRasterOpenIO">cupsRasterOpenIO</a></li>
<li><a href="#cupsRasterReadHeader">cupsRasterReadHeader</a></li>
<li><a href="#cupsRasterReadPixels">cupsRasterReadPixels</a></li>
<li><a href="#cupsRasterWriteHeader">cupsRasterWriteHeader</a></li>
<li><a href="#cupsRasterWritePixels">cupsRasterWritePixels</a></li>
<li><a href="#cupsReadResponseData">cupsReadResponseData</a></li>
<li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
<li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
<li><a href="#cupsSaveCredentials">cupsSaveCredentials</a></li>
<li><a href="#cupsSendRequest">cupsSendRequest</a></li>
<li><a href="#cupsSetClientCredentials">cupsSetClientCredentials</a></li>
<li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
<li><a href="#cupsSetDests">cupsSetDests</a></li>
<li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
<li><a href="#cupsSetOAuthCB">cupsSetOAuthCB</a></li>
<li><a href="#cupsSetPasswordCB">cupsSetPasswordCB</a></li>
<li><a href="#cupsSetServer">cupsSetServer</a></li>
<li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
<li><a href="#cupsSetUser">cupsSetUser</a></li>
<li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
<li><a href="#cupsSignCredentialsRequest">cupsSignCredentialsRequest</a></li>
<li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
<li><a href="#cupsThreadCancel">cupsThreadCancel</a></li>
<li><a href="#cupsThreadCreate">cupsThreadCreate</a></li>
<li><a href="#cupsThreadDetach">cupsThreadDetach</a></li>
<li><a href="#cupsThreadWait">cupsThreadWait</a></li>
<li><a href="#cupsUTF32ToUTF8">cupsUTF32ToUTF8</a></li>
<li><a href="#cupsUTF8ToCharset">cupsUTF8ToCharset</a></li>
<li><a href="#cupsUTF8ToUTF32">cupsUTF8ToUTF32</a></li>
<li><a href="#cupsWriteRequestData">cupsWriteRequestData</a></li>
<li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
<li><a href="#httpAddrClose">httpAddrClose</a></li>
<li><a href="#httpAddrConnect">httpAddrConnect</a></li>
<li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
<li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
<li><a href="#httpAddrGetFamily">httpAddrGetFamily</a></li>
<li><a href="#httpAddrGetLength">httpAddrGetLength</a></li>
<li><a href="#httpAddrGetList">httpAddrGetList</a></li>
<li><a href="#httpAddrGetPort">httpAddrGetPort</a></li>
<li><a href="#httpAddrGetString">httpAddrGetString</a></li>
<li><a href="#httpAddrIsAny">httpAddrIsAny</a></li>
<li><a href="#httpAddrIsEqual">httpAddrIsEqual</a></li>
<li><a href="#httpAddrIsLocalhost">httpAddrIsLocalhost</a></li>
<li><a href="#httpAddrListen">httpAddrListen</a></li>
<li><a href="#httpAddrLookup">httpAddrLookup</a></li>
<li><a href="#httpAddrSetPort">httpAddrSetPort</a></li>
<li><a href="#httpAssembleURI">httpAssembleURI</a></li>
<li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
<li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
<li><a href="#httpClearCookie">httpClearCookie</a></li>
<li><a href="#httpClearFields">httpClearFields</a></li>
<li><a href="#httpClose">httpClose</a></li>
<li><a href="#httpConnect">httpConnect</a></li>
<li><a href="#httpConnectAgain">httpConnectAgain</a></li>
<li><a href="#httpCopyPeerCredentials">httpCopyPeerCredentials</a></li>
<li><a href="#httpDecode64">httpDecode64</a></li>
<li><a href="#httpEncode64">httpEncode64</a></li>
<li><a href="#httpFieldValue">httpFieldValue</a></li>
<li><a href="#httpFlush">httpFlush</a></li>
<li><a href="#httpFlushWrite">httpFlushWrite</a></li>
<li><a href="#httpGetActivity">httpGetActivity</a></li>
<li><a href="#httpGetAddress">httpGetAddress</a></li>
<li><a href="#httpGetAuthString">httpGetAuthString</a></li>
<li><a href="#httpGetBlocking">httpGetBlocking</a></li>
<li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
<li><a href="#httpGetCookie">httpGetCookie</a></li>
<li><a href="#httpGetDateString">httpGetDateString</a></li>
<li><a href="#httpGetDateTime">httpGetDateTime</a></li>
<li><a href="#httpGetEncryption">httpGetEncryption</a></li>
<li><a href="#httpGetError">httpGetError</a></li>
<li><a href="#httpGetExpect">httpGetExpect</a></li>
<li><a href="#httpGetFd">httpGetFd</a></li>
<li><a href="#httpGetField">httpGetField</a></li>
<li><a href="#httpGetHostname">httpGetHostname</a></li>
<li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
<li><a href="#httpGetLength">httpGetLength</a></li>
<li><a href="#httpGetPending">httpGetPending</a></li>
<li><a href="#httpGetReady">httpGetReady</a></li>
<li><a href="#httpGetRemaining">httpGetRemaining</a></li>
<li><a href="#httpGetState">httpGetState</a></li>
<li><a href="#httpGetStatus">httpGetStatus</a></li>
<li><a href="#httpGetSubField">httpGetSubField</a></li>
<li><a href="#httpGetVersion">httpGetVersion</a></li>
<li><a href="#httpGets">httpGets</a></li>
<li><a href="#httpInitialize">httpInitialize</a></li>
<li><a href="#httpIsChunked">httpIsChunked</a></li>
<li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
<li><a href="#httpPeek">httpPeek</a></li>
<li><a href="#httpPrintf">httpPrintf</a></li>
<li><a href="#httpRead">httpRead</a></li>
<li><a href="#httpReadRequest">httpReadRequest</a></li>
<li><a href="#httpResolveHostname">httpResolveHostname</a></li>
<li><a href="#httpResolveURI">httpResolveURI</a></li>
<li><a href="#httpSeparateURI">httpSeparateURI</a></li>
<li><a href="#httpSetAuthString">httpSetAuthString</a></li>
<li><a href="#httpSetBlocking">httpSetBlocking</a></li>
<li><a href="#httpSetCookie">httpSetCookie</a></li>
<li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
<li><a href="#httpSetEncryption">httpSetEncryption</a></li>
<li><a href="#httpSetExpect">httpSetExpect</a></li>
<li><a href="#httpSetField">httpSetField</a></li>
<li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
<li><a href="#httpSetLength">httpSetLength</a></li>
<li><a href="#httpSetTimeout">httpSetTimeout</a></li>
<li><a href="#httpShutdown">httpShutdown</a></li>
<li><a href="#httpStateString">httpStateString</a></li>
<li><a href="#httpStatusString">httpStatusString</a></li>
<li><a href="#httpURIStatusString">httpURIStatusString</a></li>
<li><a href="#httpUpdate">httpUpdate</a></li>
<li><a href="#httpWait">httpWait</a></li>
<li><a href="#httpWrite">httpWrite</a></li>
<li><a href="#httpWriteRequest">httpWriteRequest</a></li>
<li><a href="#httpWriteResponse">httpWriteResponse</a></li>
<li><a href="#ippAddBoolean">ippAddBoolean</a></li>
<li><a href="#ippAddBooleans">ippAddBooleans</a></li>
<li><a href="#ippAddCollection">ippAddCollection</a></li>
<li><a href="#ippAddCollections">ippAddCollections</a></li>
<li><a href="#ippAddCredentialsString">ippAddCredentialsString</a></li>
<li><a href="#ippAddDate">ippAddDate</a></li>
<li><a href="#ippAddInteger">ippAddInteger</a></li>
<li><a href="#ippAddIntegers">ippAddIntegers</a></li>
<li><a href="#ippAddOctetString">ippAddOctetString</a></li>
<li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
<li><a href="#ippAddRange">ippAddRange</a></li>
<li><a href="#ippAddRanges">ippAddRanges</a></li>
<li><a href="#ippAddResolution">ippAddResolution</a></li>
<li><a href="#ippAddResolutions">ippAddResolutions</a></li>
<li><a href="#ippAddSeparator">ippAddSeparator</a></li>
<li><a href="#ippAddString">ippAddString</a></li>
<li><a href="#ippAddStringf">ippAddStringf</a></li>
<li><a href="#ippAddStringfv">ippAddStringfv</a></li>
<li><a href="#ippAddStrings">ippAddStrings</a></li>
<li><a href="#ippAttributeString">ippAttributeString</a></li>
<li><a href="#ippContainsInteger">ippContainsInteger</a></li>
<li><a href="#ippContainsString">ippContainsString</a></li>
<li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
<li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
<li><a href="#ippCopyCredentialsString">ippCopyCredentialsString</a></li>
<li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
<li><a href="#ippDateToTime">ippDateToTime</a></li>
<li><a href="#ippDelete">ippDelete</a></li>
<li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
<li><a href="#ippDeleteValues">ippDeleteValues</a></li>
<li><a href="#ippEnumString">ippEnumString</a></li>
<li><a href="#ippEnumValue">ippEnumValue</a></li>
<li><a href="#ippErrorString">ippErrorString</a></li>
<li><a href="#ippErrorValue">ippErrorValue</a></li>
<li><a href="#ippFileClose">ippFileClose</a></li>
<li><a href="#ippFileDelete">ippFileDelete</a></li>
<li><a href="#ippFileExpandVars">ippFileExpandVars</a></li>
<li><a href="#ippFileGetAttribute">ippFileGetAttribute</a></li>
<li><a href="#ippFileGetAttributes">ippFileGetAttributes</a></li>
<li><a href="#ippFileGetFilename">ippFileGetFilename</a></li>
<li><a href="#ippFileGetLineNumber">ippFileGetLineNumber</a></li>
<li><a href="#ippFileGetVar">ippFileGetVar</a></li>
<li><a href="#ippFileNew">ippFileNew</a></li>
<li><a href="#ippFileOpen">ippFileOpen</a></li>
<li><a href="#ippFileRead">ippFileRead</a></li>
<li><a href="#ippFileReadCollection">ippFileReadCollection</a></li>
<li><a href="#ippFileReadToken">ippFileReadToken</a></li>
<li><a href="#ippFileRestorePosition">ippFileRestorePosition</a></li>
<li><a href="#ippFileSavePosition">ippFileSavePosition</a></li>
<li><a href="#ippFileSetAttributes">ippFileSetAttributes</a></li>
<li><a href="#ippFileSetGroupTag">ippFileSetGroupTag</a></li>
<li><a href="#ippFileSetVar">ippFileSetVar</a></li>
<li><a href="#ippFileSetVarf">ippFileSetVarf</a></li>
<li><a href="#ippFileWriteAttributes">ippFileWriteAttributes</a></li>
<li><a href="#ippFileWriteComment">ippFileWriteComment</a></li>
<li><a href="#ippFileWriteToken">ippFileWriteToken</a></li>
<li><a href="#ippFileWriteTokenf">ippFileWriteTokenf</a></li>
<li><a href="#ippFindAttribute">ippFindAttribute</a></li>
<li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
<li><a href="#ippGetBoolean">ippGetBoolean</a></li>
<li><a href="#ippGetCollection">ippGetCollection</a></li>
<li><a href="#ippGetCount">ippGetCount</a></li>
<li><a href="#ippGetDate">ippGetDate</a></li>
<li><a href="#ippGetFirstAttribute">ippGetFirstAttribute</a></li>
<li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
<li><a href="#ippGetInteger">ippGetInteger</a></li>
<li><a href="#ippGetLength">ippGetLength</a></li>
<li><a href="#ippGetName">ippGetName</a></li>
<li><a href="#ippGetNextAttribute">ippGetNextAttribute</a></li>
<li><a href="#ippGetOctetString">ippGetOctetString</a></li>
<li><a href="#ippGetOperation">ippGetOperation</a></li>
<li><a href="#ippGetPort">ippGetPort</a></li>
<li><a href="#ippGetRange">ippGetRange</a></li>
<li><a href="#ippGetRequestId">ippGetRequestId</a></li>
<li><a href="#ippGetResolution">ippGetResolution</a></li>
<li><a href="#ippGetState">ippGetState</a></li>
<li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
<li><a href="#ippGetString">ippGetString</a></li>
<li><a href="#ippGetValueTag">ippGetValueTag</a></li>
<li><a href="#ippGetVersion">ippGetVersion</a></li>
<li><a href="#ippNew">ippNew</a></li>
<li><a href="#ippNewRequest">ippNewRequest</a></li>
<li><a href="#ippNewResponse">ippNewResponse</a></li>
<li><a href="#ippOpString">ippOpString</a></li>
<li><a href="#ippOpValue">ippOpValue</a></li>
<li><a href="#ippRead">ippRead</a></li>
<li><a href="#ippReadFile">ippReadFile</a></li>
<li><a href="#ippReadIO">ippReadIO</a></li>
<li><a href="#ippRestore">ippRestore</a></li>
<li><a href="#ippSave">ippSave</a></li>
<li><a href="#ippSetBoolean">ippSetBoolean</a></li>
<li><a href="#ippSetCollection">ippSetCollection</a></li>
<li><a href="#ippSetDate">ippSetDate</a></li>
<li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
<li><a href="#ippSetInteger">ippSetInteger</a></li>
<li><a href="#ippSetName">ippSetName</a></li>
<li><a href="#ippSetOctetString">ippSetOctetString</a></li>
<li><a href="#ippSetOperation">ippSetOperation</a></li>
<li><a href="#ippSetPort">ippSetPort</a></li>
<li><a href="#ippSetRange">ippSetRange</a></li>
<li><a href="#ippSetRequestId">ippSetRequestId</a></li>
<li><a href="#ippSetResolution">ippSetResolution</a></li>
<li><a href="#ippSetState">ippSetState</a></li>
<li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
<li><a href="#ippSetString">ippSetString</a></li>
<li><a href="#ippSetStringf">ippSetStringf</a></li>
<li><a href="#ippSetStringfv">ippSetStringfv</a></li>
<li><a href="#ippSetValueTag">ippSetValueTag</a></li>
<li><a href="#ippSetVersion">ippSetVersion</a></li>
<li><a href="#ippStateString">ippStateString</a></li>
<li><a href="#ippTagString">ippTagString</a></li>
<li><a href="#ippTagValue">ippTagValue</a></li>
<li><a href="#ippTimeToDate">ippTimeToDate</a></li>
<li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
<li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
<li><a href="#ippWrite">ippWrite</a></li>
<li><a href="#ippWriteFile">ippWriteFile</a></li>
<li><a href="#ippWriteIO">ippWriteIO</a></li>
<li><a href="#pwgFormatSizeName">pwgFormatSizeName</a></li>
<li><a href="#pwgInitSize">pwgInitSize</a></li>
<li><a href="#pwgMediaForLegacy">pwgMediaForLegacy</a></li>
<li><a href="#pwgMediaForPPD">pwgMediaForPPD</a></li>
<li><a href="#pwgMediaForPWG">pwgMediaForPWG</a></li>
<li><a href="#pwgMediaForSize">pwgMediaForSize</a></li>
</ul></li>
<li><a href="#TYPES">Data Types</a><ul class="subcontents">
<li><a href="#cups_acopy_cb_t">cups_acopy_cb_t</a></li>
<li><a href="#cups_adv_t">cups_adv_t</a></li>
<li><a href="#cups_afree_cb_t">cups_afree_cb_t</a></li>
<li><a href="#cups_ahash_cb_t">cups_ahash_cb_t</a></li>
<li><a href="#cups_array_cb_t">cups_array_cb_t</a></li>
<li><a href="#cups_array_t">cups_array_t</a></li>
<li><a href="#cups_bool_t">cups_bool_t</a></li>
<li><a href="#cups_cert_san_cb_t">cups_cert_san_cb_t</a></li>
<li><a href="#cups_cond_t">cups_cond_t</a></li>
<li><a href="#cups_credpurpose_t">cups_credpurpose_t</a></li>
<li><a href="#cups_credtype_t">cups_credtype_t</a></li>
<li><a href="#cups_credusage_t">cups_credusage_t</a></li>
<li><a href="#cups_cspace_t">cups_cspace_t</a></li>
<li><a href="#cups_cut_t">cups_cut_t</a></li>
<li><a href="#cups_dentry_t">cups_dentry_t</a></li>
<li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
<li><a href="#cups_dest_flags_t">cups_dest_flags_t</a></li>
<li><a href="#cups_dest_t">cups_dest_t</a></li>
<li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
<li><a href="#cups_dir_t">cups_dir_t</a></li>
<li><a href="#cups_dnssd_browse_cb_t">cups_dnssd_browse_cb_t</a></li>
<li><a href="#cups_dnssd_error_cb_t">cups_dnssd_error_cb_t</a></li>
<li><a href="#cups_dnssd_flags_t">cups_dnssd_flags_t</a></li>
<li><a href="#cups_dnssd_query_cb_t">cups_dnssd_query_cb_t</a></li>
<li><a href="#cups_dnssd_query_t">cups_dnssd_query_t</a></li>
<li><a href="#cups_dnssd_resolve_cb_t">cups_dnssd_resolve_cb_t</a></li>
<li><a href="#cups_dnssd_resolve_t">cups_dnssd_resolve_t</a></li>
<li><a href="#cups_dnssd_browse_t">cups_dnssd_browse_t</a></li>
<li><a href="#cups_dnssd_service_cb_t">cups_dnssd_service_cb_t</a></li>
<li><a href="#cups_dnssd_service_t">cups_dnssd_service_t</a></li>
<li><a href="#cups_dnssd_t">cups_dnssd_t</a></li>
<li><a href="#cups_edge_t">cups_edge_t</a></li>
<li><a href="#cups_utf32_t">cups_utf32_t</a></li>
<li><a href="#cups_file_t">cups_file_t</a></li>
<li><a href="#cups_job_t">cups_job_t</a></li>
<li><a href="#cups_jog_t">cups_jog_t</a></li>
<li><a href="#cups_json_t">cups_json_t</a></li>
<li><a href="#cups_jtype_t">cups_jtype_t</a></li>
<li><a href="#cups_jwa_t">cups_jwa_t</a></li>
<li><a href="#cups_jws_format_t">cups_jws_format_t</a></li>
<li><a href="#cups_jwt_t">cups_jwt_t</a></li>
<li><a href="#cups_lang_t">cups_lang_t</a></li>
<li><a href="#cups_media_flags_t">cups_media_flags_t</a></li>
<li><a href="#cups_media_t">cups_media_t</a></li>
<li><a href="#cups_mediapos_t">cups_mediapos_t</a></li>
<li><a href="#cups_mutex_t">cups_mutex_t</a></li>
<li><a href="#cups_oauth_cb_t">cups_oauth_cb_t</a></li>
<li><a href="#cups_ogrant_t">cups_ogrant_t</a></li>
<li><a href="#cups_option_t">cups_option_t</a></li>
<li><a href="#cups_order_t">cups_order_t</a></li>
<li><a href="#cups_orient_t">cups_orient_t</a></li>
<li><a href="#cups_page_header_t">cups_page_header_t</a></li>
<li><a href="#cups_password_cb_t">cups_password_cb_t</a></li>
<li><a href="#cups_ptype_t">cups_ptype_t</a></li>
<li><a href="#cups_raster_mode_t">cups_raster_mode_t</a></li>
<li><a href="#cups_raster_t">cups_raster_t</a></li>
<li><a href="#cups_rwlock_t">cups_rwlock_t</a></li>
<li><a href="#cups_thread_func_t">cups_thread_func_t</a></li>
<li><a href="#cups_thread_key_t">cups_thread_key_t</a></li>
<li><a href="#cups_thread_t">cups_thread_t</a></li>
<li><a href="#cups_whichjobs_t">cups_whichjobs_t</a></li>
<li><a href="#http_addr_t">http_addr_t</a></li>
<li><a href="#http_addrlist_t">http_addrlist_t</a></li>
<li><a href="#http_encoding_t">http_encoding_t</a></li>
<li><a href="#http_encryption_t">http_encryption_t</a></li>
<li><a href="#http_field_t">http_field_t</a></li>
<li><a href="#http_keepalive_t">http_keepalive_t</a></li>
<li><a href="#http_resolve_cb_t">http_resolve_cb_t</a></li>
<li><a href="#http_resolve_t">http_resolve_t</a></li>
<li><a href="#http_state_t">http_state_t</a></li>
<li><a href="#http_status_t">http_status_t</a></li>
<li><a href="#http_t">http_t</a></li>
<li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
<li><a href="#http_trust_t">http_trust_t</a></li>
<li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
<li><a href="#http_uri_status_t">http_uri_status_t</a></li>
<li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
<li><a href="#ipp_copy_cb_t">ipp_copy_cb_t</a></li>
<li><a href="#ipp_dstate_t">ipp_dstate_t</a></li>
<li><a href="#ipp_fattr_cb_t">ipp_fattr_cb_t</a></li>
<li><a href="#ipp_ferror_cb_t">ipp_ferror_cb_t</a></li>
<li><a href="#ipp_file_t">ipp_file_t</a></li>
<li><a href="#ipp_ftoken_cb_t">ipp_ftoken_cb_t</a></li>
<li><a href="#ipp_io_cb_t">ipp_io_cb_t</a></li>
<li><a href="#ipp_jstate_t">ipp_jstate_t</a></li>
<li><a href="#ipp_op_t">ipp_op_t</a></li>
<li><a href="#ipp_orient_t">ipp_orient_t</a></li>
<li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
<li><a href="#ipp_quality_t">ipp_quality_t</a></li>
<li><a href="#ipp_res_t">ipp_res_t</a></li>
<li><a href="#ipp_rstate_t">ipp_rstate_t</a></li>
<li><a href="#ipp_sstate_t">ipp_sstate_t</a></li>
<li><a href="#ipp_state_t">ipp_state_t</a></li>
<li><a href="#ipp_t">ipp_t</a></li>
<li><a href="#ipp_uchar_t">ipp_uchar_t</a></li>
<li><a href="#pwg_media_t">pwg_media_t</a></li>
</ul></li>
<li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
<li><a href="#cups_dentry_s">cups_dentry_s</a></li>
<li><a href="#cups_dest_s">cups_dest_s</a></li>
<li><a href="#cups_job_s">cups_job_s</a></li>
<li><a href="#cups_media_s">cups_media_s</a></li>
<li><a href="#cups_option_s">cups_option_s</a></li>
<li><a href="#cups_page_header_s">cups_page_header_s</a></li>
<li><a href="#http_addrlist_s">http_addrlist_s</a></li>
<li><a href="#pwg_media_s">pwg_media_s</a></li>
</ul></li>
<li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
<li><a href="#cups_adv_e">cups_adv_e</a></li>
<li><a href="#cups_bool_e">cups_bool_e</a></li>
<li><a href="#cups_credpurpose_e">cups_credpurpose_e</a></li>
<li><a href="#cups_credtype_e">cups_credtype_e</a></li>
<li><a href="#cups_credusage_e">cups_credusage_e</a></li>
<li><a href="#cups_cspace_e">cups_cspace_e</a></li>
<li><a href="#cups_cut_e">cups_cut_e</a></li>
<li><a href="#cups_dest_flags_e">cups_dest_flags_e</a></li>
<li><a href="#cups_dnssd_flags_e">cups_dnssd_flags_e</a></li>
<li><a href="#cups_dnssd_rrtype_e">cups_dnssd_rrtype_e</a></li>
<li><a href="#cups_edge_e">cups_edge_e</a></li>
<li><a href="#cups_encoding_e">cups_encoding_e</a></li>
<li><a href="#cups_jog_e">cups_jog_e</a></li>
<li><a href="#cups_jtype_e">cups_jtype_e</a></li>
<li><a href="#cups_jwa_e">cups_jwa_e</a></li>
<li><a href="#cups_jws_format_e">cups_jws_format_e</a></li>
<li><a href="#cups_media_flags_e">cups_media_flags_e</a></li>
<li><a href="#cups_mediapos_e">cups_mediapos_e</a></li>
<li><a href="#cups_ogrant_e">cups_ogrant_e</a></li>
<li><a href="#cups_order_e">cups_order_e</a></li>
<li><a href="#cups_orient_e">cups_orient_e</a></li>
<li><a href="#cups_ptype_e">cups_ptype_e</a></li>
<li><a href="#cups_raster_mode_e">cups_raster_mode_e</a></li>
<li><a href="#cups_whichjobs_e">cups_whichjobs_e</a></li>
<li><a href="#http_encoding_e">http_encoding_e</a></li>
<li><a href="#http_encryption_e">http_encryption_e</a></li>
<li><a href="#http_field_e">http_field_e</a></li>
<li><a href="#http_keepalive_e">http_keepalive_e</a></li>
<li><a href="#http_resolve_e">http_resolve_e</a></li>
<li><a href="#http_state_e">http_state_e</a></li>
<li><a href="#http_status_e">http_status_e</a></li>
<li><a href="#http_trust_e">http_trust_e</a></li>
<li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
<li><a href="#http_uri_status_e">http_uri_status_e</a></li>
<li><a href="#ipp_dstate_e">ipp_dstate_e</a></li>
<li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
<li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
<li><a href="#ipp_op_e">ipp_op_e</a></li>
<li><a href="#ipp_orient_e">ipp_orient_e</a></li>
<li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
<li><a href="#ipp_quality_e">ipp_quality_e</a></li>
<li><a href="#ipp_res_e">ipp_res_e</a></li>
<li><a href="#ipp_rstate_e">ipp_rstate_e</a></li>
<li><a href="#ipp_sstate_e">ipp_sstate_e</a></li>
<li><a href="#ipp_state_e">ipp_state_e</a></li>
<li><a href="#ipp_status_e">ipp_status_e</a></li>
<li><a href="#ipp_tag_e">ipp_tag_e</a></li>
</ul></li>
</ul>
</div>
<div class="body">
<blockquote>
<p>Please <a href="https://github.com/openprinting/libcups/issues">file issues on Github</a> to provide feedback on this document.</p>
</blockquote>
<h2 class="title" id="introduction">Introduction</h2>
<p>CUPS provides the &quot;cups&quot; library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The &quot;cups&quot; library functions are accessed by including the <code>&lt;cups/cups.h&gt;</code> header.</p>
<p>CUPS is based on the Internet Printing Protocol (&quot;IPP&quot;), which allows clients (applications) to communicate with a server (the scheduler, printers, etc.) to get a list of destinations, send print jobs, and so forth. You identify which server you want to communicate with using a pointer to the opaque structure <code>http_t</code>. The <code>CUPS_HTTP_DEFAULT</code> constant can be used when you want to talk to the CUPS scheduler.</p>
<h3 class="title" id="guidelines">Guidelines</h3>
<p>When writing software that uses the &quot;cups&quot; library:</p>
<ul>
<li><p>Do not use undocumented, private, or deprecated APIs,</p>
</li>
<li><p>Do not rely on pre-configured printers,</p>
</li>
<li><p>Do not assume that printers support specific features or formats, and</p>
</li>
<li><p>Do not rely on implementation details.</p>
</li>
</ul>
<p>CUPS is designed to insulate users and developers from the implementation details of printers and file formats. The goal is to allow an application to supply a print file in a standard format with the user intent (&quot;print four copies, two-sided on A4 media, and staple each copy&quot;) and have the printing system manage the printer communication and format conversion needed.</p>
<p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p>
<h3 class="title" id="terms-used-in-this-document">Terms Used in This Document</h3>
<p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
<h3 class="title" id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</h3>
<p>The CUPS libraries can be used from any C, C++, or Objective C program. The method of compiling against the libraries varies depending on the operating system and installation of CUPS. The following sections show how to compile a simple program (shown below) in two common environments.</p>
<p>The following simple program lists the available destinations:</p>
<pre><code class="language-c"><span class="directive">#include &lt;stdio.h&gt;</span>
<span class="directive">#include &lt;cups/cups.h&gt;</span>

<span class="reserved">bool</span> print_dest(<span class="reserved">void</span> *cb_data, <span class="reserved">unsigned</span> flags, cups_dest_t *dest)
{
  <span class="reserved">if</span> (dest-&gt;instance)
    printf(<span class="string">&quot;%s/%s\n&quot;</span>, dest-&gt;name, dest-&gt;instance);
  <span class="reserved">else</span>
    puts(dest-&gt;name);

  <span class="reserved">return</span> (<span class="reserved">true</span>);
}

<span class="reserved">int</span> main(<span class="reserved">void</span>)
{
  cupsEnumDests(CUPS_DEST_FLAGS_NONE, <span class="number">1000</span>, NULL, <span class="number">0</span>, <span class="number">0</span>, print_dest, NULL);

  <span class="reserved">return</span> (<span class="number">0</span>);
}
</code></pre>
<h4 id="compiling-with-xcode">Compiling with Xcode</h4>
<p>In Xcode, choose <em>New Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command Line Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example &quot;firstcups&quot;. Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
<p>In the project window, click on the <em>Build Phases</em> group and expand the <em>Link Binary with Libraries</em> section. Click <em>+</em>, choose &quot;Other...&quot;, and then find and choose the <code>libcups3.dylib</code> file in <code>/usr/local/lib</code>.</p>
<p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p>
<h4 id="compiling-with-gcc">Compiling with GCC</h4>
<p>From the command-line, create a file called <code>simple.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
<pre><code>gcc -o simple `pkg-config --cflags cups3` simple.c `pkg-config --libs cups3`
./simple
</code></pre>
<p>The <code>pkg-config</code> command provides the compiler flags (<code>pkg-config --cflags cups3</code>) and libraries (<code>pkg-config --libs cups3</code>) needed for the local system.</p>
<h2 class="title" id="working-with-destinations">Working with Destinations</h2>
<p>Destinations, which in CUPS represent individual printers or classes (collections or pools) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (&quot;name&quot;), instance (&quot;instance&quot;, saved options/settings), whether the destination is the default for the user (&quot;is_default&quot;), and the options and basic information associated with that destination (&quot;num_options&quot; and &quot;options&quot;).</p>
<p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p>
<h3 class="title" id="finding-available-destinations">Finding Available Destinations</h3>
<p>The <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> function finds all of the available destinations:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
cupsEnumDests(<span class="reserved">unsigned</span> flags, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel,
              cups_ptype_t type, cups_ptype_t mask,
              cups_dest_cb_t cb, <span class="reserved">void</span> *cb_data)
</code></pre>
<p>The &quot;flags&quot; argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
<p>The &quot;msec&quot; argument specifies the maximum amount of time that should be used for enumeration in milliseconds - interactive applications should keep this value to 5000 or less when run on the main thread.</p>
<p>The &quot;cancel&quot; argument points to an integer variable that, when set to a non-zero value, will cause enumeration to stop as soon as possible. It can be <code>NULL</code> if not needed.</p>
<p>The &quot;type&quot; and &quot;mask&quot; arguments are bitfields that allow the caller to filter the destinations based on categories and/or capabilities. The destination's &quot;printer-type&quot; value is masked by the &quot;mask&quot; value and compared to the &quot;type&quot; value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PTYPE_LOCAL</code> for the &quot;type&quot; argument and <code>CUPS_PTYPE_DISCOVERED</code> for the &quot;mask&quot; argument. The following constants can be used for filtering:</p>
<ul>
<li><p><code>CUPS_PTYPE_CLASS</code>: A collection of destinations.</p>
</li>
<li><p><code>CUPS_PTYPE_FAX</code>: A facsimile device.</p>
</li>
<li><p><code>CUPS_PTYPE_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the &quot;type&quot; argument and is paired with the <code>CUPS_PTYPE_REMOTE</code> or <code>CUPS_PTYPE_DISCOVERED</code> constant passed in the &quot;mask&quot; argument.</p>
</li>
<li><p><code>CUPS_PTYPE_REMOTE</code>: A remote (shared) printer or class.</p>
</li>
<li><p><code>CUPS_PTYPE_DISCOVERED</code>: An available network printer or class.</p>
</li>
<li><p><code>CUPS_PTYPE_BW</code>: Can do B&amp;W printing.</p>
</li>
<li><p><code>CUPS_PTYPE_COLOR</code>: Can do color printing.</p>
</li>
<li><p><code>CUPS_PTYPE_DUPLEX</code>: Can do two-sided printing.</p>
</li>
<li><p><code>CUPS_PTYPE_STAPLE</code>: Can staple output.</p>
</li>
<li><p><code>CUPS_PTYPE_COLLATE</code>: Can quickly collate copies.</p>
</li>
<li><p><code>CUPS_PTYPE_PUNCH</code>: Can punch output.</p>
</li>
<li><p><code>CUPS_PTYPE_COVER</code>: Can cover output.</p>
</li>
<li><p><code>CUPS_PTYPE_BIND</code>: Can bind output.</p>
</li>
<li><p><code>CUPS_PTYPE_FOLD</code>: Can fold output.</p>
</li>
<li><p><code>CUPS_PTYPE_SORT</code>: Can sort output (mailboxes, etc.)</p>
</li>
<li><p><code>CUPS_PTYPE_SMALL</code>: Can print on Letter/Legal/A4-size media.</p>
</li>
<li><p><code>CUPS_PTYPE_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</p>
</li>
<li><p><code>CUPS_PTYPE_LARGE</code>: Can print on D/E/A1/A0-size media.</p>
</li>
<li><p><code>CUPS_PTYPE_VARIABLE</code>: Can print on rolls and custom-size media.</p>
</li>
</ul>
<p>The &quot;cb&quot; argument specifies a function to call for every destination that is found:</p>
<pre><code class="language-c"><span class="reserved">typedef</span> <span class="reserved">bool</span> (*cups_dest_cb_t)(<span class="reserved">void</span> *cb_data,
                               <span class="reserved">unsigned</span> flags,
                               cups_dest_t *dest);
</code></pre>
<p>The callback function receives a copy of the &quot;cb_data&quot; argument along with a bitfield (&quot;flags&quot;) and the destination that was found. The &quot;flags&quot; argument can have any of the following constant (bit) values set:</p>
<ul>
<li><p><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</p>
</li>
<li><p><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</p>
</li>
<li><p><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <a href="#cupsGetError"><code>cupsGetError</code></a> and/or <a href="#cupsGetErrorString"><code>cupsGetErrorString</code></a> functions.</p>
</li>
</ul>
<p>The callback function returns <code>false</code> to stop enumeration or <code>true</code> to continue.</p>
<blockquote>
<p><strong>Note:</strong></p>
<p>The callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p>
</blockquote>
<p>The following example shows how to use <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> to get a filtered array of destinations:</p>
<pre><code class="language-c"><span class="reserved">typedef</span> <span class="reserved">struct</span>
{
  size_t num_dests;
  cups_dest_t *dests;
} my_cb_data_t;

<span class="reserved">bool</span>
my_dest_cb(my_cb_data_t *cb_data, <span class="reserved">unsigned</span> flags,
           cups_dest_t *dest)
{
  <span class="reserved">if</span> (flags &amp; CUPS_DEST_FLAGS_REMOVED)
  {
    <span class="comment">// Remove destination from array...</span>
    cb_data-&gt;num_dests =
        cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
                       cb_data-&gt;num_dests,
                       &amp;(cb_data-&gt;dests));
  }
  <span class="reserved">else</span>
  {
    <span class="comment">// Add destination to array...</span>
    cb_data-&gt;num_dests =
        cupsCopyDest(dest, cb_data-&gt;num_dests,
                     &amp;(cb_data-&gt;dests));
  }

  <span class="reserved">return</span> (<span class="reserved">true</span>);
}

size_t                     <span class="comment">// O - Number of destinations</span>
my_get_dests(
    cups_ptype_t type,     <span class="comment">// I - Printer type bit values</span>
    cups_ptype_t mask,     <span class="comment">// I - Printer type mask values</span>
    cups_dest_t  **dests)  <span class="comment">// O - Destinations</span>
{
  my_cb_data_t cb_data = { <span class="number">0</span>, NULL };

  <span class="reserved">if</span> (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, <span class="number">1000</span>, NULL, type,
                     mask, (cups_dest_cb_t)my_dest_cb,
                     &amp;cb_data))
  {
    <span class="comment">// An error occurred, free all of the destinations and</span>
    <span class="comment">// return...</span>
    cupsFreeDests(cb_data.num_dests, cb_data.dests);

    *dests = NULL;

    <span class="reserved">return</span> (<span class="number">0</span>);
  }

  <span class="comment">// Return the destination array...</span>
  *dests = cb_data.dests;

  <span class="reserved">return</span> (cb_data.num_dests);
}
</code></pre>
<h3 class="title" id="basic-destination-information">Basic Destination Information</h3>
<p>The &quot;num_options&quot; and &quot;options&quot; members of the <code>cups_dest_t</code> structure provide basic attributes about the destination in addition to the user default options and values for that destination. The following names are predefined for various destination attributes:</p>
<ul>
<li><p>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</p>
</li>
<li><p>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</p>
</li>
<li><p>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</p>
</li>
<li><p>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</p>
</li>
<li><p>&quot;printer-make-and-model&quot;: The human-readable make and model of the destination such as &quot;ExampleCorp LaserPrinter 4000 Series&quot;.</p>
</li>
<li><p>&quot;printer-state&quot;: &quot;3&quot; if the destination is idle, &quot;4&quot; if the destination is printing a job, and &quot;5&quot; if the destination is stopped.</p>
</li>
<li><p>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</p>
</li>
<li><p>&quot;printer-state-reasons&quot;: Additional comma-delimited state keywords for the destination such as &quot;media-tray-empty-error&quot; and &quot;toner-low-warning&quot;.</p>
</li>
<li><p>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</p>
</li>
<li><p>&quot;printer-uri-supported&quot;: The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</p>
</li>
</ul>
<p>Use the <a href="#cupsGetOption"><code>cupsGetOption</code></a> function to retrieve the value. For example, the following code gets the make and model of a destination:</p>
<pre><code class="language-c"><span class="reserved">const</span> <span class="reserved">char</span> *model = cupsGetOption(<span class="string">&quot;printer-make-and-model&quot;</span>,
                                  dest-&gt;num_options,
                                  dest-&gt;options);
</code></pre>
<h3 class="title" id="detailed-destination-information">Detailed Destination Information</h3>
<p>Once a destination has been chosen, the <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a> function can be used to gather detailed information about the destination:</p>
<pre><code class="language-c">cups_dinfo_t *
cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
</code></pre>
<p>The &quot;http&quot; argument specifies a connection to the CUPS scheduler and is typically the constant <code>CUPS_HTTP_DEFAULT</code>. The &quot;dest&quot; argument specifies the destination to query.</p>
<p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p>
<h4 id="getting-supported-options-and-values">Getting Supported Options and Values</h4>
<p>The <a href="#cupsCheckDestSupported"><code>cupsCheckDestSupported</code></a> function can be used to test whether a particular option or option and value is supported:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
                       cups_dinfo_t *info,
                       <span class="reserved">const</span> <span class="reserved">char</span> *option,
                       <span class="reserved">const</span> <span class="reserved">char</span> *value);
</code></pre>
<p>The &quot;option&quot; argument specifies the name of the option to check. The following constants can be used to check the various standard options:</p>
<ul>
<li><p><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</p>
</li>
<li><p><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</p>
</li>
<li><p><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</p>
</li>
<li><p><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</p>
</li>
<li><p><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</p>
</li>
<li><p><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</p>
</li>
<li><p><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</p>
</li>
<li><p><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</p>
</li>
<li><p><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</p>
</li>
<li><p><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</p>
</li>
</ul>
<p>If the &quot;value&quot; argument is <code>NULL</code>, the <a href="#cupsCheckDestSupported"><code>cupsCheckDestSupported</code></a> function returns whether the option is supported by the destination. Otherwise, the function returns whether the specified value of the option is supported.</p>
<p>The <a href="#cupsFindDestSupported"><code>cupsFindDestSupported</code></a> function returns the IPP attribute containing the supported values for a given option:</p>
<pre><code class="language-c">ipp_attribute_t *
cupsFindDestSupported(http_t *http, cups_dest_t *dest,
                      cups_dinfo_t *dinfo,
                      <span class="reserved">const</span> <span class="reserved">char</span> *option);
</code></pre>
<p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
<pre><code class="language-c">cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, dest);

<span class="reserved">if</span> (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
                           CUPS_FINISHINGS, NULL))
{
  ipp_attribute_t *finishings =
      cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
                            CUPS_FINISHINGS);
  size_t i, count = ippGetCount(finishings);

  puts(<span class="string">&quot;finishings supported:&quot;</span>);
  <span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
    printf(<span class="string">&quot;  %d (%s)\n&quot;</span>, ippGetInteger(finishings, i),
           ippEnumString(<span class="string">&quot;finishings&quot;</span>, ippGetInteger(finishings, i)));
}
<span class="reserved">else</span>
  puts(<span class="string">&quot;finishings not supported.&quot;</span>);
</code></pre>
<p>The &quot;job-creation-attributes&quot; option can be queried to get a list of supported options. For example, the following code prints the list of supported options to the standard output:</p>
<pre><code class="language-c">ipp_attribute_t *attrs =
    cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
                          <span class="string">&quot;job-creation-attributes&quot;</span>);
size_t i, count = ippGetCount(attrs);

<span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
  puts(ippGetString(attrs, i, NULL));
</code></pre>
<h4 id="getting-default-values">Getting Default Values</h4>
<p>There are two sets of default values - user defaults that are available via the &quot;num_options&quot; and &quot;options&quot; members of the <code>cups_dest_t</code> structure, and destination defaults that available via the <code>cups_dinfo_t</code> structure and the <a href="#cupsFindDestDefault"><code>cupsFindDestDefault</code></a> function which returns the IPP attribute containing the default value(s) for a given option:</p>
<pre><code class="language-c">ipp_attribute_t *
cupsFindDestDefault(http_t *http, cups_dest_t *dest,
                    cups_dinfo_t *dinfo,
                    <span class="reserved">const</span> <span class="reserved">char</span> *option);
</code></pre>
<p>The user defaults from <a href="#cupsGetOption"><code>cupsGetOption</code></a> should always take preference over the destination defaults. For example, the following code prints the default finishings value(s) to the standard output:</p>
<pre><code class="language-c"><span class="reserved">const</span> <span class="reserved">char</span> *def_value =
    cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
                  dest-&gt;options);
ipp_attribute_t *def_attr =
    cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
                        CUPS_FINISHINGS);

<span class="reserved">if</span> (def_value != NULL)
{
  printf(<span class="string">&quot;Default finishings: %s\n&quot;</span>, def_value);
}
<span class="reserved">else</span>
{
  <span class="reserved">int</span> i, count = ippGetCount(def_attr);

  printf(<span class="string">&quot;Default finishings: %d&quot;</span>,
         ippGetInteger(def_attr, <span class="number">0</span>));
  <span class="reserved">for</span> (i = <span class="number">1</span>; i &lt; count; i ++)
    printf(<span class="string">&quot;,%d&quot;</span>, ippGetInteger(def_attr, i));
  putchar(<span class="string">'\n'</span>);
}
</code></pre>
<h4 id="getting-ready-loaded-values">Getting Ready (Loaded) Values</h4>
<p>The finishings and media options also support queries for the ready, or loaded, values. For example, a printer may have punch and staple finishers installed but be out of staples - the supported values will list both punch and staple finishing processes but the ready values will only list the punch processes. Similarly, a printer may support hundreds of different sizes of media but only have a single size loaded at any given time - the ready values are limited to the media that is actually in the printer.</p>
<p>The <a href="#cupsFindDestReady"><code>cupsFindDestReady</code></a> function finds the IPP attribute containing the ready values for a given option:</p>
<pre><code class="language-c">ipp_attribute_t *
cupsFindDestReady(http_t *http, cups_dest_t *dest,
                  cups_dinfo_t *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option);
</code></pre>
<p>For example, the following code lists the ready finishing processes:</p>
<pre><code class="language-c">ipp_attribute_t *ready_finishings =
    cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
                      CUPS_FINISHINGS);

<span class="reserved">if</span> (ready_finishings != NULL)
{
  <span class="reserved">int</span> i, count = ippGetCount(ready_finishings);

  puts(<span class="string">&quot;finishings ready:&quot;</span>);
  <span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
    printf(<span class="string">&quot;  %d\n&quot;</span>, ippGetInteger(ready_finishings, i));
}
<span class="reserved">else</span>
  puts(<span class="string">&quot;no finishings are ready.&quot;</span>);
</code></pre>
<h4 id="media-options">Media Options</h4>
<p>CUPS provides functions for querying the dimensions, margins, color, source (tray/roll), and type for each of the supported media size options. The <code>cups_media_t</code> structure is used to describe media:</p>
<pre><code class="language-c"><span class="reserved">typedef</span> <span class="reserved">struct</span> cups_media_s
{
  <span class="reserved">char</span> media[<span class="number">128</span>];
  <span class="reserved">char</span> color[<span class="number">128</span>];
  <span class="reserved">char</span> source[<span class="number">128</span>];
  <span class="reserved">char</span> type[<span class="number">128</span>];
  <span class="reserved">int</span> width, length;
  <span class="reserved">int</span> bottom, left, right, top;
} cups_media_t;
</code></pre>
<p>The &quot;media&quot; member specifies a PWG self-describing media size name such as &quot;na_letter_8.5x11in&quot;, &quot;iso_a4_210x297mm&quot;, etc. The &quot;color&quot; member specifies a PWG media color name such as &quot;white&quot;, &quot;blue&quot;, etc. The &quot;source&quot; member specifies a standard keyword for the paper tray or roll such as &quot;tray-1&quot;, &quot;manual&quot;, &quot;by-pass-tray&quot; (multi-purpose tray), etc. The &quot;type&quot; member specifies a PWG media type name such as &quot;stationery&quot; (plain paper), &quot;photographic&quot;, &quot;envelope&quot;, &quot;transparency&quot;, etc.</p>
<p>The &quot;width&quot; and &quot;length&quot; members specify the dimensions of the media in hundredths of millimeters (1/2540th of an inch). The &quot;bottom&quot;, &quot;left&quot;, &quot;right&quot;, and &quot;top&quot; members specify the margins of the printable area, also in hundredths of millimeters.</p>
<p>The <a href="#cupsGetDestMediaByName"><code>cupsGetDestMediaByName</code></a> and <a href="#cupsGetDestMediaBySize"><code>cupsGetDestMediaBySize</code></a> functions lookup the media information using a standard media size name or dimensions in hundredths of millimeters:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
                       cups_dinfo_t *dinfo,
                       <span class="reserved">const</span> <span class="reserved">char</span> *media,
                       <span class="reserved">unsigned</span> flags, cups_media_t *size);

<span class="reserved">bool</span>
cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
                       cups_dinfo_t *dinfo,
                       <span class="reserved">int</span> width, <span class="reserved">int</span> length,
                       <span class="reserved">unsigned</span> flags, cups_media_t *size);
</code></pre>
<p>The &quot;media&quot;, &quot;width&quot;, and &quot;length&quot; arguments specify the size to lookup. The &quot;flags&quot; argument specifies a bitfield controlling various lookup options:</p>
<ul>
<li><p><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</p>
</li>
<li><p><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</p>
</li>
<li><p><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</p>
</li>
<li><p><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</p>
</li>
<li><p><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the &quot;ready&quot; media.</p>
</li>
</ul>
<p>If a matching size is found for the destination, the size information is stored in the structure pointed to by the &quot;size&quot; argument and <code>true</code> is returned. Otherwise <code>false</code> is returned.</p>
<p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
<pre><code class="language-c">cups_media_t size;

<span class="reserved">if</span> (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
                           CUPS_MEDIA_LETTER,
                           CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
{
  puts(<span class="string">&quot;Margins for duplex US Letter:&quot;</span>);
  printf(<span class="string">&quot;  Bottom: %.2fin\n&quot;</span>, size.bottom / <span class="number">2540.0</span>);
  printf(<span class="string">&quot;    Left: %.2fin\n&quot;</span>, size.left / <span class="number">2540.0</span>);
  printf(<span class="string">&quot;   Right: %.2fin\n&quot;</span>, size.right / <span class="number">2540.0</span>);
  printf(<span class="string">&quot;     Top: %.2fin\n&quot;</span>, size.top / <span class="number">2540.0</span>);
}
<span class="reserved">else</span>
  puts(<span class="string">&quot;Margins for duplex US Letter are not available.&quot;</span>);
</code></pre>
<p>You can also enumerate all of the sizes that match a given &quot;flags&quot; value using the <a href="#cupsGetDestMediaByIndex"><code>cupsGetDestMediaByIndex</code></a> and <a href="#cupsGetDestMediaCount"><code>cupsGetDestMediaCount</code></a> functions:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
                        cups_dinfo_t *dinfo, size_t n,
                        <span class="reserved">unsigned</span> flags, cups_media_t *size);

size_t
cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
                      cups_dinfo_t *dinfo, <span class="reserved">unsigned</span> flags);
</code></pre>
<p>For example, the following code prints the list of ready media and corresponding margins:</p>
<pre><code class="language-c">cups_media_t media;
size_t i;
size_t count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
                                     dest, info,
                                     CUPS_MEDIA_FLAGS_READY);

<span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
{
  <span class="reserved">if</span> (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
                              i, CUPS_MEDIA_FLAGS_READY,
                              &amp;size))
  {
    printf(<span class="string">&quot;%s:\n&quot;</span>, media.name);
    printf(<span class="string">&quot;    Width: %.2fin\n&quot;</span>, media.width / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;   Length: %.2fin\n&quot;</span>, media.length / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;   Bottom: %.2fin\n&quot;</span>, media.bottom / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;     Left: %.2fin\n&quot;</span>, media.left / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;    Right: %.2fin\n&quot;</span>, media.right / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;      Top: %.2fin\n&quot;</span>, media.top / <span class="number">2540.0</span>);
    printf(<span class="string">&quot;Tray/Roll: %s\n&quot;</span>, media.source);
    printf(<span class="string">&quot;    Color: %s\n&quot;</span>, media.color);
    printf(<span class="string">&quot;     Type: %s\n&quot;</span>, media.type);
  }
}
</code></pre>
<p>Finally, the <a href="#cupsGetDestMediaDefault"><code>cupsGetDestMediaDefault</code></a> function returns the default media size:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
                        cups_dinfo_t *dinfo, <span class="reserved">unsigned</span> flags,
                        cups_media_t *size);
</code></pre>
<h4 id="localizing-options-and-values">Localizing Options and Values</h4>
<p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <a href="#cupsLocalizeDestMedia"><code>cupsLocalizeDestMedia</code></a>, <a href="#cupsLocalizeDestOption"><code>cupsLocalizeDestOption</code></a>, and <a href="#cupsLocalizeDestValue"><code>cupsLocalizeDestValue</code></a>:</p>
<pre><code class="language-c"><span class="reserved">const</span> <span class="reserved">char</span> *
cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
                      cups_dinfo_t *info, <span class="reserved">unsigned</span> flags,
                      cups_media_t *media);

<span class="reserved">const</span> <span class="reserved">char</span> *
cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
                       cups_dinfo_t *info,
                       <span class="reserved">const</span> <span class="reserved">char</span> *option);

<span class="reserved">const</span> <span class="reserved">char</span> *
cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
                      cups_dinfo_t *info,
                      <span class="reserved">const</span> <span class="reserved">char</span> *option, <span class="reserved">const</span> <span class="reserved">char</span> *value);
</code></pre>
<blockquote>
<p><strong>Note:</strong></p>
<p>These functions require a valid <code>http_t</code> connection to work. Use the <a href="#cupsConnectDest"><code>cupsConnectDest</code></a> function to connect to the destination for its localization information.</p>
</blockquote>
<p>For example, the following code will list the localized media names for a destination:</p>
<pre><code class="language-c"><span class="reserved">char</span> resource[<span class="number">256</span>];
http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE,
                               <span class="comment">/*msec*/</span><span class="number">30000</span>, <span class="comment">/*cancel*/</span>NULL,
                               resource, <span class="reserved">sizeof</span>(resource),
                               <span class="comment">/*dest_cb*/</span>NULL, <span class="comment">/*user_data*/</span>NULL);

size_t i;
size_t count = cupsGetDestMediaCount(http, dest, info,
                                     CUPS_MEDIA_FLAGS_DEFAULT);
cups_media_t media;
<span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
{
  <span class="reserved">if</span> (cupsGetDestMediaByIndex(http, dest, info, i,
                              CUPS_MEDIA_FLAGS_DEFAULT, &amp;media))
    printf(<span class="string">&quot;%s: %s\n&quot;</span>, media.name,
           cupsLocalizeDestMedia(http, dest, info,
                                 CUPS_MEDIA_FLAGS_DEFAULT, &amp;media));
}
</code></pre>
<h3 class="title" id="submitting-a-print-job">Submitting a Print Job</h3>
<p>Once you are ready to submit a print job, you create a job using the <a href="#cupsCreateDestJob"><code>cupsCreateDestJob</code></a> function:</p>
<pre><code class="language-c">ipp_status_t
cupsCreateDestJob(http_t *http, cups_dest_t *dest,
                  cups_dinfo_t *info, <span class="reserved">int</span> *job_id,
                  <span class="reserved">const</span> <span class="reserved">char</span> *title, <span class="reserved">int</span> num_options,
                  cups_option_t *options);
</code></pre>
<p>The &quot;title&quot; argument specifies a name for the print job such as &quot;My Document&quot;. The &quot;num_options&quot; and &quot;options&quot; arguments specify the options for the print job which are allocated using the <a href="#cupsAddOption"><code>cupsAddOption</code></a> function.</p>
<p>When successful, the job's numeric identifier is stored in the integer pointed to by the &quot;job_id&quot; argument and <code>IPP_STATUS_OK</code> is returned. Otherwise, an IPP error status is returned.</p>
<p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
<pre><code class="language-c"><span class="reserved">int</span> job_id = <span class="number">0</span>;
size_ num_options = <span class="number">0</span>;
cups_option_t *options = NULL;

num_options = cupsAddIntegerOption(CUPS_COPIES, <span class="number">42</span>,
                                   num_options, &amp;options);
num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
                            num_options, &amp;options);
num_options = cupsAddOption(CUPS_SIDES,
                            CUPS_SIDES_TWO_SIDED_PORTRAIT,
                            num_options, &amp;options);

<span class="reserved">if</span> (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
                      &amp;job_id, <span class="string">&quot;My Document&quot;</span>, num_options,
                      options) == IPP_STATUS_OK)
  printf(<span class="string">&quot;Created job: %d\n&quot;</span>, job_id);
<span class="reserved">else</span>
  printf(<span class="string">&quot;Unable to create job: %s\n&quot;</span>,
         cupsGetErrorString());
</code></pre>
<p>Once the job is created, you submit documents for the job using the <a href="#cupsStartDestDocument"><code>cupsStartDestDocument</code></a>, <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a>, and <a href="#cupsFinishDestDocument"><code>cupsFinishDestDocument</code></a> functions:</p>
<pre><code class="language-c">http_status_t
cupsStartDestDocument(http_t *http, cups_dest_t *dest,
                      cups_dinfo_t *info, <span class="reserved">int</span> job_id,
                      <span class="reserved">const</span> <span class="reserved">char</span> *docname,
                      <span class="reserved">const</span> <span class="reserved">char</span> *format,
                      size_t num_options,
                      cups_option_t *options,
                      <span class="reserved">bool</span> last_document);

http_status_t
cupsWriteRequestData(http_t *http, <span class="reserved">const</span> <span class="reserved">char</span> *buffer,
                     size_t length);

ipp_status_t
cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
                       cups_dinfo_t *info);
</code></pre>
<p>The &quot;docname&quot; argument specifies the name of the document, typically the original filename. The &quot;format&quot; argument specifies the MIME media type of the document, including the following constants:</p>
<ul>
<li><p><code>CUPS_FORMAT_AUTO</code>: &quot;application/octet-stream&quot;</p>
</li>
<li><p><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</p>
</li>
<li><p><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</p>
</li>
<li><p><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</p>
</li>
</ul>
<p>The &quot;num_options&quot; and &quot;options&quot; arguments specify per-document print options, which at present must be <code>0</code> and <code>NULL</code>. The &quot;last_document&quot; argument specifies whether this is the last document in the job.</p>
<p>For example, the following code submits a PDF file to the job that was just created:</p>
<pre><code class="language-c">FILE *fp = fopen(<span class="string">&quot;filename.pdf&quot;</span>, <span class="string">&quot;rb&quot;</span>);
size_t bytes;
<span class="reserved">char</span> buffer[<span class="number">65536</span>];

<span class="reserved">if</span> (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
                          job_id, <span class="string">&quot;filename.pdf&quot;</span>, <span class="number">0</span>, NULL,
                          <span class="number">1</span>) == HTTP_STATUS_CONTINUE)
{
  <span class="reserved">while</span> ((bytes = fread(buffer, <span class="number">1</span>, <span class="reserved">sizeof</span>(buffer), fp)) &gt; <span class="number">0</span>)
  {
    <span class="reserved">if</span> (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
                             bytes) != HTTP_STATUS_CONTINUE)
      <span class="reserved">break</span>;
  }

  <span class="reserved">if</span> (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
                             info) == IPP_STATUS_OK)
    puts(<span class="string">&quot;Document send succeeded.&quot;</span>);
  <span class="reserved">else</span>
    printf(<span class="string">&quot;Document send failed: %s\n&quot;</span>,
           cupsGetErrorString());
}

fclose(fp);
</code></pre>
<h2 class="title" id="sending-ipp-requests">Sending IPP Requests</h2>
<p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p>
<h3 class="title" id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</h3>
<p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <a href="#cupsConnectDest"><code>cupsConnectDest</code></a> function connects to the scheduler or printer associated with the destination:</p>
<pre><code class="language-c">http_t *
cupsConnectDest(cups_dest_t *dest, <span class="reserved">unsigned</span> flags, <span class="reserved">int</span> msec,
                <span class="reserved">int</span> *cancel, <span class="reserved">char</span> *resource,
                size_t resourcesize, cups_dest_cb_t cb,
                <span class="reserved">void</span> *cb_data);
</code></pre>
<p>The &quot;dest&quot; argument specifies the destination to connect to.</p>
<p>The &quot;flags&quot; argument specifies whether you want to connect to the scheduler (<code>CUPS_DEST_FLAGS_NONE</code>) or device/printer (<code>CUPS_DEST_FLAGS_DEVICE</code>) associated with the destination.</p>
<p>The &quot;msec&quot; argument specifies how long you are willing to wait for the connection to be established in milliseconds. Specify a value of <code>-1</code> to wait indefinitely.</p>
<p>The &quot;cancel&quot; argument specifies the address of an integer variable that can be set to a non-zero value to cancel the connection. Specify a value of <code>NULL</code> to not provide a cancel variable.</p>
<p>The &quot;resource&quot; and &quot;resourcesize&quot; arguments specify the address and size of a character string array to hold the path to use when sending an IPP request.</p>
<p>The &quot;cb&quot; and &quot;cb_data&quot; arguments specify a destination callback function that returns <code>true</code> to continue connecting or <code>false</code> to stop. The destination callback works the same way as the one used for the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> function.</p>
<p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
<p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
<pre><code class="language-c"><span class="reserved">char</span> resource[<span class="number">256</span>];
http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
                               <span class="number">30000</span>, <span class="comment">/*cancel*/</span>NULL, resource,
                               <span class="reserved">sizeof</span>(resource),
                               <span class="comment">/*cb*/</span>NULL, <span class="comment">/*cb_data*/</span>NULL);
</code></pre>
<h3 class="title" id="creating-an-ipp-request">Creating an IPP Request</h3>
<p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p>
<p>The <a href="#ippNewRequest"><code>ippNewRequest</code></a> function creates a new IPP request with a process-unique identifier:</p>
<pre><code class="language-c">ipp_t *
ippNewRequest(ipp_op_t op);
</code></pre>
<p>The &quot;op&quot; argument specifies the IPP operation code for the request. For example, the following code creates an IPP Get-Printer-Attributes request:</p>
<pre><code class="language-c">ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
</code></pre>
<p>The request identifier is automatically set to a unique value for the current process.</p>
<p>Each IPP request starts with two IPP attributes, &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot;, followed by IPP attribute(s) that specify the target of the operation. The <a href="#ippNewRequest"><code>ippNewRequest</code></a> function automatically adds the correct &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot; attributes, but you must add the target attribute(s). For example, the following code adds the &quot;printer-uri&quot; attribute to the IPP Get-Printer-Attributes request to specify which printer is being queried:</p>
<pre><code class="language-c"><span class="reserved">const</span> <span class="reserved">char</span> *printer_uri = cupsGetOption(<span class="string">&quot;device-uri&quot;</span>,
                                        dest-&gt;num_options,
                                        dest-&gt;options);

ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
             <span class="string">&quot;printer-uri&quot;</span>, <span class="comment">/*language*/</span>NULL, printer_uri);
</code></pre>
<blockquote>
<p><strong>Note:</strong></p>
<p>If we wanted to query the scheduler instead of the device, we would look up the &quot;printer-uri-supported&quot; option instead of the &quot;device-uri&quot; value.</p>
</blockquote>
<p>The <a href="#ippAddString"><code>ippAddString</code></a> function adds the &quot;printer-uri&quot; attribute the the IPP request. The <code>IPP_TAG_OPERATION</code> argument specifies that the attribute is part of the operation attributes group. The <code>IPP_TAG_URI</code> argument specifies that the value is a Universal Resource Identifier (URI) string. The <code>NULL</code> argument specifies there is no language (English, French, Japanese, etc.) associated with the string, and the &quot;printer_uri&quot; argument specifies the string value.</p>
<p>The IPP Get-Printer-Attributes request also supports an IPP attribute called &quot;requested-attributes&quot; that lists the attributes and values you are interested in. For example, the following code requests the printer state attributes:</p>
<pre><code class="language-c"><span class="reserved">static</span> <span class="reserved">const</span> <span class="reserved">char</span> * <span class="reserved">const</span> requested_attributes[] =
{
  <span class="string">&quot;printer-state&quot;</span>,
  <span class="string">&quot;printer-state-message&quot;</span>,
  <span class="string">&quot;printer-state-reasons&quot;</span>
};

ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
              <span class="string">&quot;requested-attributes&quot;</span>, <span class="number">3</span>, NULL,
              requested_attributes);
</code></pre>
<p>The <a href="#ippAddStrings"><code>ippAddStrings</code></a> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p>
<p>CUPS provides many functions to adding attributes of different types:</p>
<ul>
<li><p><a href="#ippAddBoolean"><code>ippAddBoolean</code></a> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</p>
</li>
<li><p><a href="#ippAddCollection"><code>ippAddCollection</code></a> adds a collection (<code>IPP_TAG_BEGIN_COLLECTION</code>) attribute with one value.</p>
</li>
<li><p><a href="#ippAddCollections"><code>ippAddCollections</code></a> adds a collection (<code>IPP_TAG_BEGIN_COLLECTION</code>) attribute with one or more values.</p>
</li>
<li><p><a href="#ippAddInteger"><code>ippAddInteger</code></a> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</p>
</li>
<li><p><a href="#ippAddIntegers"><code>ippAddIntegers</code></a> adds an enum or integer attribute with one or more values.</p>
</li>
<li><p><a href="#ippAddOctetString"><code>ippAddOctetString</code></a> adds an octetString attribute with one value.</p>
</li>
<li><p><a href="#ippAddOutOfBand"><code>ippAddOutOfBand</code></a> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</p>
</li>
<li><p><a href="#ippAddRange"><code>ippAddRange</code></a> adds a rangeOfInteger attribute with one range.</p>
</li>
<li><p><a href="#ippAddRanges"><code>ippAddRanges</code></a> adds a rangeOfInteger attribute with one or more ranges.</p>
</li>
<li><p><a href="#ippAddResolution"><code>ippAddResolution</code></a> adds a resolution attribute with one resolution.</p>
</li>
<li><p><a href="#ippAddResolutions"><code>ippAddResolutions</code></a> adds a resolution attribute with one or more resolutions.</p>
</li>
<li><p><a href="#ippAddString"><code>ippAddString</code></a> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</p>
</li>
<li><p><a href="#ippAddStrings"><code>ippAddStrings</code></a> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</p>
</li>
</ul>
<h3 class="title" id="sending-the-ipp-request">Sending the IPP Request</h3>
<p>Once you have created the IPP request, you can send it using the <a href="#cupsDoRequest"><code>cupsDoRequest</code></a> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p>
<pre><code class="language-c">ipp_t *response = cupsDoRequest(http, request, resource);
</code></pre>
<p>For requests like Send-Document that include a file, the <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a> function should be used:</p>
<pre><code class="language-c">ipp_t *response = cupsDoFileRequest(http, request, resource,
                                    filename);
</code></pre>
<p>Both <a href="#cupsDoRequest"><code>cupsDoRequest</code></a> and <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a> free the IPP request. If a valid IPP response is received, it is stored in a new IPP message (<code>ipp_t</code>) and returned to the caller. Otherwise <code>NULL</code> is returned.</p>
<p>The status from the most recent request can be queried using the <a href="#cupsGetError"><code>cupsGetError</code></a> function, for example:</p>
<pre><code class="language-c"><span class="reserved">if</span> (cupsGetError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
{
  <span class="comment">/* request failed */</span>
}
</code></pre>
<p>A human-readable error message is also available using the <a href="#cupsGetErrorString"><code>cupsGetErrorString</code></a> function:</p>
<pre><code class="language-c"><span class="reserved">if</span> (cupsGetError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
{
  <span class="comment">/* request failed */</span>
  printf(<span class="string">&quot;Request failed: %s\n&quot;</span>, cupsGetErrorString());
}
</code></pre>
<h3 class="title" id="processing-the-ipp-response">Processing the IPP Response</h3>
<p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p>
<p>CUPS provides many functions to access the attributes and values in an IPP response message:</p>
<ul>
<li><p><a href="#ippFindAttribute"><code>ippFindAttribute</code></a> finds the first occurrence of an attribute.</p>
</li>
<li><p><a href="#ippFindNextAttribute"><code>ippFindNextAttribute</code></a> finds the next occurrence of an attribute.</p>
</li>
<li><p><a href="#ippGetBoolean"><code>ippGetBoolean</code></a> gets a boolean value for an attribute.</p>
</li>
<li><p><a href="#ippGetCollection"><code>ippGetCollection</code></a> gets a collection value for an attribute.</p>
</li>
<li><p><a href="#ippGetCount"><code>ippGetCount</code></a> gets the number of values in an attribute.</p>
</li>
<li><p><a href="#ippGetDate"><code>ippGetDate</code></a> gets a date value for an attribute.</p>
</li>
<li><p><a href="#ippGetFirstAttribute"><code>ippGetFirstAttribute</code></a> gets the first attribute in the IPP response.</p>
</li>
<li><p><a href="#ippGetGroupTag"><code>ippGetGroupTag</code></a> gets the group tag associated with an attribute.</p>
</li>
<li><p><a href="#ippGetInteger"><code>ippGetInteger</code></a> gets the integer or enum value for an attribute.</p>
</li>
<li><p><a href="#ippGetName"><code>ippGetName</code></a> gets the name of an attribute.</p>
</li>
<li><p><a href="#ippGetNextAttribute"><code>ippGetNextAttribute</code></a> gets the next attribute in the IPP response.</p>
</li>
<li><p><a href="#ippGetOctetString"><code>ippGetOctetString</code></a> gets an octetString value for an attribute.</p>
</li>
<li><p><a href="#ippGetRange"><code>ippGetRange</code></a> gets a rangeOfInteger value for an attribute.</p>
</li>
<li><p><a href="#ippGetRequestId"><code>ippGetRequestId</code></a> gets the request ID number for the IPP response.</p>
</li>
<li><p><a href="#ippGetResolution"><code>ippGetResolution</code></a> gets a resolution value for an attribute.</p>
</li>
<li><p><a href="#ippGetStatusCode"><code>ippGetStatusCode</code></a> gets the status code for the IPP response.</p>
</li>
<li><p><a href="#ippGetString"><code>ippGetString</code></a> gets a string value for an attribute.</p>
</li>
<li><p><a href="#ippGetValueTag"><code>ippGetValueTag</code></a> gets the value tag (&quot;syntax&quot;) for an attribute.</p>
</li>
<li><p><a href="#ippGetVersion"><code>ippGetVersion</code></a> gets the IPP version used for the IPP response.</p>
</li>
<li><p><a href="#ippRestore"><code>ippRestore</code></a> restores a previous position in the IPP response.</p>
</li>
<li><p><a href="#ippSave"><code>ippSave</code></a> saves the current position in the IPP response.</p>
</li>
</ul>
<p>For example, the following code finds the printer state attributes and prints their values:</p>
<pre><code class="language-c">ipp_attribute_t *attr;

<span class="reserved">if</span> ((attr = ippFindAttribute(response, <span class="string">&quot;printer-state&quot;</span>,
                             IPP_TAG_ENUM)) != NULL)
{
  printf(<span class="string">&quot;printer-state=%s\n&quot;</span>,
         ippEnumString(<span class="string">&quot;printer-state&quot;</span>, ippGetInteger(attr, <span class="number">0</span>)));
}
<span class="reserved">else</span>
{
  puts(<span class="string">&quot;printer-state=unknown&quot;</span>);
}

<span class="reserved">if</span> ((attr = ippFindAttribute(response, <span class="string">&quot;printer-state-message&quot;</span>,
                             IPP_TAG_TEXT)) != NULL)
{
  printf(<span class="string">&quot;printer-state-message=\&quot;%s\&quot;\n&quot;</span>,
         ippGetString(attr, <span class="number">0</span>, NULL)));
}

<span class="reserved">if</span> ((attr = ippFindAttribute(response, <span class="string">&quot;printer-state-reasons&quot;</span>,
                             IPP_TAG_KEYWORD)) != NULL)
{
  size_t i, count = ippGetCount(attr);

  puts(<span class="string">&quot;printer-state-reasons=&quot;</span>);
  <span class="reserved">for</span> (i = <span class="number">0</span>; i &lt; count; i ++)
    printf(<span class="string">&quot;    %s\n&quot;</span>, ippGetString(attr, i, NULL)));
}
</code></pre>
<p>Once you are done using the IPP response message, free it using the <a href="#ippDelete"><code>ippDelete</code></a> function:</p>
<pre><code>ippDelete(response);
</code></pre>
<h3 class="title" id="authentication">Authentication</h3>
<p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> function:</p>
<pre><code class="language-c"><span class="reserved">void</span>
cupsSetPasswordCB(cups_password_cb_t cb, <span class="reserved">void</span> *cb_data);
</code></pre>
<p>The password callback will be called when needed and is responsible for setting the current user name using <a href="#cupsSetUser"><code>cupsSetUser</code></a> and returning a string:</p>
<pre><code class="language-c"><span class="reserved">const</span> <span class="reserved">char</span> *
cups_password_cb(<span class="reserved">const</span> <span class="reserved">char</span> *prompt, http_t *http,
                 <span class="reserved">const</span> <span class="reserved">char</span> *method, <span class="reserved">const</span> <span class="reserved">char</span> *resource,
                 <span class="reserved">void</span> *cb_data);
</code></pre>
<p>The &quot;prompt&quot; argument is a string from CUPS that should be displayed to the user.</p>
<p>The &quot;http&quot; argument is the connection hosting the request that is being authenticated. The password callback can call the <a href="#httpGetField"><code>httpGetField</code></a> and <a href="#httpGetSubField"><code>httpGetSubField</code></a> functions to look for additional details concerning the authentication challenge.</p>
<p>The &quot;method&quot; argument specifies the HTTP method used for the request and is typically &quot;POST&quot;.</p>
<p>The &quot;resource&quot; argument specifies the path used for the request.</p>
<p>The &quot;cb_data&quot; argument provides the user data pointer from the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> call.</p>
<h2 class="title" id="ipp-data-file-api">IPP Data File API</h2>
<p>The IPP data file API provides functions to read and write IPP attributes and other commands or data using a common base format that supports tools such as <code>ipptool</code> and <code>ippeveprinter</code>.</p>
<h3 class="title" id="creating-an-ipp-data-file">Creating an IPP Data File</h3>
<p>The <a href="#ippFileNew"><code>ippFileNew</code></a> function creates a new IPP data file (<code>ipp_file_t</code>) object:</p>
<pre><code class="language-c">ipp_file_t *parent = NULL;
<span class="reserved">void</span> *data;
ipp_file_t *file = ippFileNew(parent, attr_cb, error_cb, data);
</code></pre>
<p>The &quot;parent&quot; IPP data file pointer is typically used to support nested files and is normally <code>NULL</code> for a new file. The &quot;data&quot; argument supplies your application data to the callbacks. The &quot;attr_cb&quot; callback function is used to filter IPP attributes; return <code>true</code> to include the attribute and <code>false</code> to ignore it:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
attr_cb(ipp_file_t *file, <span class="reserved">void</span> *cb_data, <span class="reserved">const</span> <span class="reserved">char</span> *name)
{
  ... determine whether to use an attribute named <span class="string">&quot;name&quot;</span> ...
}
</code></pre>
<p>The &quot;error_cb&quot; callback function is used to record/report errors when reading the file:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
error_cb(ipp_file_t *file, <span class="reserved">void</span> *cb_data, <span class="reserved">const</span> <span class="reserved">char</span> *error)
{
  ... display/record error <span class="reserved">and</span> <span class="reserved">return</span> `<span class="reserved">true</span>` to <span class="reserved">continue</span> <span class="reserved">or</span> `<span class="reserved">false</span>` to stop ...
}
</code></pre>
<h3 class="title" id="reading-a-data-file">Reading a Data File</h3>
<p>The <a href="#ippFileOpen"><code>ippFileOpen</code></a> function opens the specified data file and <a href="#ippFileRead"><code>ippFileRead</code></a> reads from it:</p>
<pre><code class="language-c"><span class="reserved">if</span> (ippFileOpen(file, <span class="string">&quot;somefile&quot;</span>, <span class="string">&quot;r&quot;</span>))
{
  <span class="comment">// Opened successfully, now read it...</span>
  ippFileRead(file, token_cb, <span class="comment">/*with_groups*/</span><span class="reserved">false</span>);
  ippFileClose(file);
}
</code></pre>
<p>The token callback function passed to <code>ippFileRead</code> handles custom directives in your data file:</p>
<pre><code class="language-c"><span class="reserved">bool</span>
token_cb(ipp_file_t *file, <span class="reserved">void</span> *cb_data, <span class="reserved">const</span> <span class="reserved">char</span> *token)
{
  ... handle token, <span class="reserved">return</span> `<span class="reserved">true</span>` to <span class="reserved">continue</span> <span class="reserved">or</span> `<span class="reserved">false</span>` to stop ...
}
</code></pre>
<p>The &quot;token&quot; parameter contains the token to be processed. The callback can use the <a href="#ippFileReadToken"><code>ippFileReadToken</code></a> function to read additional tokens from the file and the <a href="#ippFileExpandToken"><code>ippFileExpandToken</code></a> function to expand any variables in the token string. Return <code>false</code> to stop reading the file and <code>true</code> to continue. The default <code>NULL</code> callback reports an unknown token error through the error callback end returns <code>false</code>.</p>
<p>Once read, you call the <a href="#ippFileGetAttributes"><code>ippFileGetAttributes</code></a> function to get the IPP attributes from the file.</p>
<h3 class="title" id="variables">Variables</h3>
<p>Each IPP data file object has associated variables that can be used when reading the file. The default set of variables is:</p>
<ul>
<li><p>&quot;date-current&quot;: Current date in ISO-8601 format</p>
</li>
<li><p>&quot;date-start&quot;: Start date (when file opened) in ISO-8601 format</p>
</li>
<li><p>&quot;filename&quot;: Associated data/document filename, if any</p>
</li>
<li><p>&quot;filetype&quot;: MIME media type of associated data/document filename, if any</p>
</li>
<li><p>&quot;hostname&quot;: Hostname or IP address from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;port&quot;: Port number from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;resource&quot;: Resource path from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;scheme&quot;: URI scheme from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;uri&quot;: URI, if any</p>
</li>
<li><p>&quot;uriuser&quot;: Username from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;uripassword&quot;: Password from the &quot;uri&quot; value, if any</p>
</li>
<li><p>&quot;user&quot;: Current login user</p>
</li>
</ul>
<p>The <a href="#ippFileGetVar"><code>ippFileGetVar</code></a>, <a href="#ippFileSetVar"><code>ippFileSetVar</code></a>, and <a href="#ippFileSetVarf"><code>ippFileSetVarf</code></a> functions get and set file variables, respectively.</p>
<h3 class="title" id="writing-ipp-data-files">Writing IPP Data Files</h3>
<p>As when reading an IPP data file, the <a href="#ippFileNew"><code>ippFileNew</code></a> function creates a new file object, <a href="#ippFileOpen"><code>ippFileOpen</code></a> opens the file, and <a href="#ippFileClose"><code>ippFileClose</code></a> closes the file. However, you call <a href="#ippFileWriteAttributes"><code>ippFileWriteAttributes</code></a> to write the attributes in an IPP message (<code>ipp_t</code>), <a href="#ippFileWriteComment"><code>ippFileWriteComment</code></a> to write a comment in the file, and <a href="#ippWriteToken"><code>ippWriteToken</code></a> or <a href="#ippWriteTokenf"><code>ippWriteTokenf</code></a> to write a token or value to the file.</p>
<h2 class="title" id="migrating-code-from-cups-2.x-and-earlier">Migrating Code from CUPS 2.x and Earlier</h2>
<p>The CUPS 3.x library removes all of the deprecated and obsolete APIs from CUPS 2.x and earlier and makes other naming changes for consistency. As a result, the CUPS 3.x library is no longer binary compatible with programs compiled against the CUPS 2.x library and earlier, and some source code may need minor changes to compile with the new library. This file describes the changes and how to migrate to the new library.</p>
<h3 class="title" id="general-changes">General Changes</h3>
<p>The following general changes have been made to the CUPS API:</p>
<ul>
<li><p>Boolean values now use the C99 <code>bool</code> type.</p>
</li>
<li><p>Counts, indices, and lengths now use the <code>size_t</code> type - this affects the array, HTTP, IPP, and option APIs in particular.</p>
</li>
<li><p>Accessor functions have been renamed (as necessary) to use the &quot;get&quot; and &quot;set&quot; verbs, for example <code>cupsServer</code> is now <code>cupsGetServer</code> and <code>httpEncryption</code> is now <code>httpSetEncryption</code>.</p>
</li>
</ul>
<h3 class="title" id="specific-api-changes">Specific API Changes</h3>
<ul>
<li><p><code>cupsDoAuthentication</code> now returns a <code>bool</code> value - <code>true</code> on success or <code>false</code> on failure - instead of the old <code>int</code> values 0 and -1, respectively.</p>
</li>
<li><p><code>httpGets</code> now has the <code>http_t</code> pointer as the first argument.</p>
</li>
<li><p>The <code>cups_size_t</code> structure now includes &quot;color&quot;, &quot;source&quot;, and &quot;type&quot; members to allow specification of media color, source (input tray/roll), and type.</p>
</li>
<li><p>The <code>cups_encoding_t</code> enumeration values now use the <code>CUPS_ENCODING_</code> prefix for consistency with other enumerated types.</p>
</li>
<li><p>X.509 certificates are now passed as C strings containing the PEM-encoded data instead of a <code>cups_array_t *</code> of raw data.</p>
</li>
</ul>
<h3 class="title" id="removed-functions-and-types">Removed Functions and Types</h3>
<p>The following CUPS 2.x API functions have been removed from the CUPS library:</p>
<ul>
<li><p>Old class/printer functions: <code>cupsGetClasses</code> and <code>cupsGetPrinters</code>.</p>
</li>
<li><p>Accessor functions: <code>cupsEncryption</code>, <code>cupsLastError</code>, <code>cupsLastErrorString</code>, <code>cupsServer</code>, <code>cupsUser</code>, and <code>cupsUserAgent</code>.</p>
</li>
<li><p>Array functions: <code>cupsArrayCount</code>, <code>cupsArrayFirst</code>, <code>cupsArrayIndex</code>, <code>cupsArrayLast</code>, <code>cupsArrayNew2</code>, <code>cupsArrayNew3</code>, <code>cupsArrayNext</code>, and <code>cupsArrayPrev</code>.</p>
</li>
<li><p>File functions: <code>cupsFileCompression</code>, <code>cupsTempFd</code>, <code>cupsTempFile</code>, and <code>cupsTempFile2</code>.</p>
</li>
<li><p>HTTP functions: <code>httpAddCredential</code>, <code>httpAddrAny</code>, <code>httpAddrEqual</code>, <code>httpAddrFamily</code>, <code>httpAddrLength</code>, <code>httpAddrLocalhost</code>, <code>httpAddrPort</code>, <code>httpAddrString</code>, <code>httpBlocking</code>, <code>httpCheck</code>, <code>httpCompareCredentials</code>, <code>httpConnectEncrypt</code>, <code>httpCopyCredentials</code>, <code>httpCreateCredentials</code>, <code>httpCredentialsAreValidForName</code>, <code>httpCredentialsGetExpiration</code>, <code>httpCredentialsGetTrust</code>, <code>httpCredentialsString</code>, <code>httpDecode64_2</code>, <code>httpDelete</code>, <code>httpEncode64_2</code>, <code>httpEncryption</code>, <code>httpError</code>, <code>httpFreeCredentials</code>, <code>httpGet</code>, <code>httpLoadCredentials</code>, <code>httpOptions</code>, <code>httpPost</code>, <code>httpPut</code>, <code>httpSaveCredentials</code>, <code>httpStatus</code>, and <code>httpTrace</code>.</p>
</li>
<li><p>IPP functions: <code>ippFirstAttribute</code>, <code>ippLength</code>, <code>ippNextAttribute</code>, and <code>ippPort</code>.</p>
</li>
<li><p>Localization functions: <code>cupsNotifySubject</code> and <code>cupsNotifyText</code>.</p>
</li>
<li><p>PPD file functions: <code>ppdClose</code>, <code>ppdCollect</code>, <code>ppdCollect2</code>, <code>ppdConflicts</code>, <code>ppdEmit</code>, <code>ppdEmitAfterOrder</code>, <code>ppdEmitFd</code>, <code>ppdEmitJCL</code>, <code>ppdEmitJCLEnd</code>, <code>ppdEmitString</code>, <code>ppdErrorString</code>, <code>ppdFindAttr</code>, <code>ppdFindChoice</code>, <code>ppdFindCustomOption</code>, <code>ppdFindCustomParam</code>, <code>ppdFindMarkedChoice</code>, <code>ppdFindNextAttr</code>, <code>ppdFindOption</code>, <code>ppdFirstCustomParam</code>, <code>ppdFirstOption</code>, <code>ppdInstallableConflict</code>, <code>ppdIsMarked</code>, <code>ppdLastError</code>, <code>ppdLocalize</code>, <code>ppdLocalizeAttr</code>, <code>ppdLocalizeIPPReason</code>, <code>ppdLocalizeMarkerName</code>, <code>ppdMarkDefaults</code>, <code>ppdMarkOption</code>, <code>ppdNextCustomParam</code>, <code>ppdNextOption</code>, <code>ppdOpen</code>, <code>ppdOpen2</code>, <code>ppdOpenFd</code>, <code>ppdOpenFile</code>, <code>ppdPageLength</code>, <code>ppdPageSize</code>, <code>ppdPageSizeLimits</code>, <code>ppdPageWidth</code>, and <code>ppdSetConformance</code>.</p>
</li>
<li><p>PPD helper functions: <code>cupsGetConflicts</code>, <code>cupsGetPPD</code>, <code>cupsGetPPD2</code>, <code>cupsGetPPD3</code>, <code>cupsGetServerPPD</code>, <code>cupsMarkOptions</code>, <code>cupsRasterInterpretPPD</code>, and <code>cupsResolveConflicts</code>.</p>
</li>
<li><p>Non-destination print functions: <code>cupsCancelJob</code>, <code>cupsCancelJob2</code>, <code>cupsCreateJob</code>, <code>cupsCloseJob</code>, <code>cupsFinishDocument</code>, <code>cupsGetDefault</code>, <code>cupsGetDefault2</code>, <code>cupsPrintFile</code>, <code>cupsPrintFile2</code>, <code>cupsPrintFiles</code>, <code>cupsPrintFiles2</code>, and <code>cupsSendDocument</code>.</p>
</li>
<li><p>Raster functions: <code>cupsRasterInitPWGHeader</code>.</p>
</li>
</ul>
<p>Similarly, the following types have been removed from CUPS 3.0:</p>
<ul>
<li><p>Array types: <code>cups_acopy_func_t</code>, <code>cups_afree_func_t</code>, and <code>cups_array_func_t</code>.</p>
</li>
<li><p>IPP types: <code>ipp_copycb_t</code> and <code>ipp_iocb_t</code>.</p>
</li>
<li><p>Media types: <code>cups_size_t</code>.</p>
</li>
<li><p>Raster types: <code>cups_mode_t</code> and <code>cups_raster_iocb_t</code>.</p>
</li>
</ul>
<h3 class="title" id="renamed-functions-and-types">Renamed Functions and Types</h3>
<p>The following functions have been renamed in CUPS 3.0:</p>
<table><thead><tr><th> Old CUPS 2.x Name</th>
<th> New CUPS 3.0 Name</th>
</tr>
</thead>
<tbody><tr><td> <code>cupsArrayNew3</code></td>
<td> <code>cupsArrayNew</code></td>
</tr>
<tr><td> <code>cupsAddDestMediaOptions2</code></td>
<td> <code>cupsAddDestMediaOptions</code></td>
</tr>
<tr><td> <code>cupsEncodeOptions2</code></td>
<td> <code>cupsEncodeOptions</code></td>
</tr>
<tr><td> <code>cupsGetDefault2</code></td>
<td> <code>cupsGetDefault</code></td>
</tr>
<tr><td> <code>cupsGetDestMediaByIndex2</code></td>
<td> <code>cupsGetDestMediaByIndex</code></td>
</tr>
<tr><td> <code>cupsGetDestMediaByName2</code></td>
<td> <code>cupsGetDestMediaByName</code></td>
</tr>
<tr><td> <code>cupsGetDestMediaBySize2</code></td>
<td> <code>cupsGetDestMediaBySize</code></td>
</tr>
<tr><td> <code>cupsGetDestMediaDefault2</code></td>
<td> <code>cupsGetDestMediaDefault</code></td>
</tr>
<tr><td> <code>cupsGetDests2</code></td>
<td> <code>cupsGetDests</code></td>
</tr>
<tr><td> <code>cupsGetJobs2</code></td>
<td> <code>cupsGetJobs</code></td>
</tr>
<tr><td> <code>cupsGetPassword2</code></td>
<td> <code>cupsGetPassword</code></td>
</tr>
<tr><td> <code>cupsLangGet</code></td>
<td> <code>cupsLangFind</code></td>
</tr>
<tr><td> <code>cupsLocalizeDestMedia2</code></td>
<td> <code>cupsLocalizeDestMedia</code></td>
</tr>
<tr><td> <code>cupsRasterReadHeader2</code></td>
<td> <code>cupsRasterReadHeader</code></td>
</tr>
<tr><td> <code>cupsRasterWriteHeader2</code></td>
<td> <code>cupsRasterWriteHeader</code></td>
</tr>
<tr><td> <code>cupsSetDests2</code></td>
<td> <code>cupsSetDests</code></td>
</tr>
<tr><td> <code>cupsSetPasswordCB2</code></td>
<td> <code>cupsSetPasswordCB</code></td>
</tr>
<tr><td> <code>httpAddrConnect2</code></td>
<td> <code>httpAddrConnect2</code></td>
</tr>
<tr><td> <code>httpConnect2</code></td>
<td> <code>httpConnect</code></td>
</tr>
<tr><td> <code>httpDecode64_3</code></td>
<td> <code>httpDecode64</code></td>
</tr>
<tr><td> <code>httpEncode64_3</code></td>
<td> <code>httpEncode64</code></td>
</tr>
<tr><td> <code>httpGetDateString2</code></td>
<td> <code>httpGetDateString</code></td>
</tr>
<tr><td> <code>httpGetLength2</code></td>
<td> <code>httpGetLength</code></td>
</tr>
<tr><td> <code>httpGetSubField2</code></td>
<td> <code>httpGetSubField</code></td>
</tr>
<tr><td> <code>httpGets2</code></td>
<td> <code>httpGets</code></td>
</tr>
<tr><td> <code>httpRead2</code></td>
<td> <code>httpRead</code></td>
</tr>
<tr><td> <code>httpReconnect2</code></td>
<td> <code>httpConnectAgain</code></td>
</tr>
<tr><td> <code>httpWrite2</code></td>
<td> <code>httpWrite</code></td>
</tr>
</tbody>
</table>
<p>Similarly, the following types have been renamed in CUPS 3.0:</p>
<table><thead><tr><th> Old CUPS 2.x Name</th>
<th> New CUPS 3.0 Name</th>
</tr>
</thead>
<tbody><tr><td> <code>cups_password_cb2_t</code></td>
<td> <code>cups_password_cb_t</code></td>
</tr>
<tr><td> <code>cups_page_header2_t</code></td>
<td> <code>cups_page_header_t</code></td>
</tr>
</tbody>
</table>
<h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
<p class="description">Add a destination to the list of destinations.</p>
<p class="code">
size_t cupsAddDest(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *instance, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function cannot be used to add a new class or printer queue,
it only adds a new container of saved options for the named
destination or instance.<br>
<br>
If the named destination already exists, the destination list is
returned unchanged.  Adding a new instance of a destination creates
a copy of that destination's options.<br>
<br>
Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
destinations to the user's lpoptions file.</p>
<h3 class="function"><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
<p class="description">Add the option corresponding to the specified media size.</p>
<p class="code">
size_t cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media, size_t num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media matching flags</td></tr>
<tr><th>media</th>
<td class="description">Media</td></tr>
<tr><th>num_options</th>
<td class="description">Current number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of options</p>
<h3 class="function"><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
<p class="description">Add an integer option to an option array.</p>
<p class="code">
size_t cupsAddIntegerOption(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">long</span> value, size_t num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>value</th>
<td class="description">Value of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">New option arrays can be initialized simply by passing 0 for the
&quot;num_options&quot; parameter.</p>
<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
<p class="description">Add an option to an option array.</p>
<p class="code">
size_t cupsAddOption(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *value, size_t num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>value</th>
<td class="description">Value of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">New option arrays can be initialized simply by passing 0 for the
&quot;num_options&quot; parameter.</p>
<h3 class="function"><a id="cupsAreCredentialsValidForName">cupsAreCredentialsValidForName</a></h3>
<p class="description">Return whether the credentials are valid
                                     for the given name.</p>
<p class="code">
<span class="reserved">bool</span> cupsAreCredentialsValidForName(<span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>common_name</th>
<td class="description">Name to check</td></tr>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if valid, <code>false</code> otherwise</p>
<h3 class="function"><a id="cupsArrayAdd">cupsArrayAdd</a></h3>
<p class="description">Add an element to an array.</p>
<p class="code">
<span class="reserved">bool</span> cupsArrayAdd(<a href="#cups_array_t">cups_array_t</a> *a, <span class="reserved">void</span> *e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>e</th>
<td class="description">Element</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds an element to an array.  When adding an element to a
sorted array, non-unique elements are appended at the end of the run of
identical elements.  For unsorted arrays, the element is appended to the end
of the array.</p>
<h3 class="function"><a id="cupsArrayAddStrings">cupsArrayAddStrings</a></h3>
<p class="description">Add zero or more delimited strings to an array.</p>
<p class="code">
<span class="reserved">bool</span> cupsArrayAddStrings(<a href="#cups_array_t">cups_array_t</a> *a, <span class="reserved">const</span> <span class="reserved">char</span> *s, <span class="reserved">char</span> delim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>s</th>
<td class="description">Delimited strings</td></tr>
<tr><th>delim</th>
<td class="description">Delimiter character</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds zero or more delimited strings to an array created using
the <a href="#cupsArrayNewStrings"><code>cupsArrayNewStrings</code></a> function. Duplicate strings are <em>not</em> added.
If the string pointer &quot;s&quot; is <code>NULL</code> or the empty string, no strings are
added to the array.  If &quot;delim&quot; is the space character, then all whitespace
is recognized as a delimiter.<br>
<br>
Strings can be delimited by quotes (&quot;foo&quot;, 'bar') and curly braces (&quot;{foo}&quot;),
and characters can be escaped using the backslash () character.  Outer
quotes are stripped but inner ones are preserved.</p>
<h3 class="function"><a id="cupsArrayClear">cupsArrayClear</a></h3>
<p class="description">Clear an array.</p>
<p class="code">
<span class="reserved">void</span> cupsArrayClear(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is equivalent to removing all elements in the array, so the
free callback (if any) is called for each element that is removed.</p>
<h3 class="function"><a id="cupsArrayDelete">cupsArrayDelete</a></h3>
<p class="description">Free all memory used by an array.</p>
<p class="code">
<span class="reserved">void</span> cupsArrayDelete(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function frees all memory used by an array.  The free callback (if any)
is called for each element in the array.</p>
<h3 class="function"><a id="cupsArrayDup">cupsArrayDup</a></h3>
<p class="description">Duplicate an array.</p>
<p class="code">
<a href="#cups_array_t">cups_array_t</a> *cupsArrayDup(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Duplicate array</p>
<h3 class="function"><a id="cupsArrayFind">cupsArrayFind</a></h3>
<p class="description">Find an element in an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayFind(<a href="#cups_array_t">cups_array_t</a> *a, <span class="reserved">void</span> *e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>e</th>
<td class="description">Element</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Element found or <code>NULL</code></p>
<h3 class="function"><a id="cupsArrayGetCount">cupsArrayGetCount</a></h3>
<p class="description">Get the number of elements in an array.</p>
<p class="code">
size_t cupsArrayGetCount(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of elements</p>
<h3 class="function"><a id="cupsArrayGetCurrent">cupsArrayGetCurrent</a></h3>
<p class="description">Return the current element in an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetCurrent(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Element</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the current element in an array.  The current element
is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, <a href="#cupsArrayGetElement"><code>cupsArrayGetElement</code></a>,
<a href="#cupsArrayGetFirst"><code>cupsArrayGetFirst</code></a>, or <a href="#cupsArrayGetLast"><code>cupsArrayGetLast</code></a>.</p>
<h3 class="function"><a id="cupsArrayGetElement">cupsArrayGetElement</a></h3>
<p class="description">Get the N-th element in the array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetElement(<a href="#cups_array_t">cups_array_t</a> *a, size_t n);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>n</th>
<td class="description">Index into array, starting at 0</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">N-th element or <code>NULL</code></p>
<h3 class="function"><a id="cupsArrayGetFirst">cupsArrayGetFirst</a></h3>
<p class="description">Get the first element in an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetFirst(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">First element or <code>NULL</code> if the array is empty</p>
<h3 class="function"><a id="cupsArrayGetIndex">cupsArrayGetIndex</a></h3>
<p class="description">Get the index of the current element.</p>
<p class="code">
size_t cupsArrayGetIndex(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Index of the current element, starting at 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the index of the current element or <code>SIZE_MAX</code> if
there is no current element.  The current element is undefined until you call
<a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, <a href="#cupsArrayGetElement"><code>cupsArrayGetElement</code></a>, <a href="#cupsArrayGetFirst"><code>cupsArrayGetFirst</code></a>,
or <a href="#cupsArrayGetLast"><code>cupsArrayGetLast</code></a>.</p>
<h3 class="function"><a id="cupsArrayGetInsert">cupsArrayGetInsert</a></h3>
<p class="description">Get the index of the last added or inserted element.</p>
<p class="code">
size_t cupsArrayGetInsert(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Index of the last added or inserted element, starting at 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the index of the last added or inserted element or
<code>SIZE_MAX</code> if no elements have been added or inserted.</p>
<h3 class="function"><a id="cupsArrayGetLast">cupsArrayGetLast</a></h3>
<p class="description">Get the last element in the array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetLast(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Last element or<code>NULL</code> if the array is empty</p>
<h3 class="function"><a id="cupsArrayGetNext">cupsArrayGetNext</a></h3>
<p class="description">Get the next element in an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetNext(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Next element or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the next element in an array.  The next element is
undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, <a href="#cupsArrayGetElement"><code>cupsArrayGetElement</code></a>,
<a href="#cupsArrayGetFirst"><code>cupsArrayGetFirst</code></a>, or <a href="#cupsArrayGetLast"><code>cupsArrayGetLast</code></a> to set the current
element.</p>
<h3 class="function"><a id="cupsArrayGetPrev">cupsArrayGetPrev</a></h3>
<p class="description">Get the previous element in an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetPrev(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Previous element or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the previous element in an array.  The previous element
is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, <a href="#cupsArrayGetElement"><code>cupsArrayGetElement</code></a>,
<a href="#cupsArrayGetFirst"><code>cupsArrayGetFirst</code></a>, or <a href="#cupsArrayGetLast"><code>cupsArrayGetLast</code></a> to set the current
element.</p>
<h3 class="function"><a id="cupsArrayGetUserData">cupsArrayGetUserData</a></h3>
<p class="description">Return the user data for an array.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayGetUserData(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User data</p>
<h3 class="function"><a id="cupsArrayInsert">cupsArrayInsert</a></h3>
<p class="description">Insert an element in an array.</p>
<p class="code">
<span class="reserved">bool</span> cupsArrayInsert(<a href="#cups_array_t">cups_array_t</a> *a, <span class="reserved">void</span> *e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>e</th>
<td class="description">Element</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function inserts an element in an array.  When inserting an element
in a sorted array, non-unique elements are inserted at the beginning of the
run of identical elements.  For unsorted arrays, the element is inserted at
the beginning of the array.</p>
<h3 class="function"><a id="cupsArrayNew">cupsArrayNew</a></h3>
<p class="description">Create a new array with callback functions.</p>
<p class="code">
<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew(<a href="#cups_array_cb_t">cups_array_cb_t</a> f, <span class="reserved">void</span> *d, <a href="#cups_ahash_cb_t">cups_ahash_cb_t</a> hf, size_t hsize, <a href="#cups_acopy_cb_t">cups_acopy_cb_t</a> cf, <a href="#cups_afree_cb_t">cups_afree_cb_t</a> ff);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>f</th>
<td class="description">Comparison callback function or <code>NULL</code> for an unsorted array</td></tr>
<tr><th>d</th>
<td class="description">User data or <code>NULL</code></td></tr>
<tr><th>hf</th>
<td class="description">Hash callback function or <code>NULL</code> for unhashed lookups</td></tr>
<tr><th>hsize</th>
<td class="description">Hash size (&gt;= <code>0</code>)</td></tr>
<tr><th>cf</th>
<td class="description">Copy callback function or <code>NULL</code> for none</td></tr>
<tr><th>ff</th>
<td class="description">Free callback function or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Array</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new array with optional callback functions.  The
comparison callback function (&quot;f&quot;) is used to create a sorted array.  The
function receives pointers to two elements and the user data pointer (&quot;d&quot;).
The user data pointer argument can safely be omitted when not required so
functions like <code>strcmp</code> can be used for sorted string arrays.

<pre>
int // Return -1 if a &lt; b, 0 if a == b, and 1 if a &gt; b
compare_cb(void *a, void *b, void *d)
{
  ... &quot;a&quot; and &quot;b&quot; are the elements, &quot;d&quot; is the user data pointer
}
</pre>

The hash callback function (&quot;hf&quot;) is used to implement cached lookups with
the specified hash size (&quot;hsize&quot;).  The function receives a pointer to an
element and the user data pointer (&quot;d&quot;) and returns an unsigned integer
representing a hash into the array.  The hash value is of type <code>size_t</code> which
provides at least 32-bits of resolution.

<pre>
size_t // Return hash value from 0 to (hashsize - 1)
hash_cb(void *e, void *d)
{
  ... &quot;e&quot; is the element, &quot;d&quot; is the user data pointer
}
</pre>

The copy callback function (&quot;cf&quot;) is used to automatically copy/retain
elements when added to the array or the array is copied with
<a href="#cupsArrayDup"><code>cupsArrayDup</code></a>.  The function receives a pointer to the element and the
user data pointer (&quot;d&quot;) and returns a new pointer that is stored in the array.

<pre>
void * // Return pointer to copied/retained element or NULL
copy_cb(void *e, void *d)
{
  ... &quot;e&quot; is the element, &quot;d&quot; is the user data pointer
}
</pre>

Finally, the free callback function (&quot;cf&quot;) is used to automatically
free/release elements when removed or the array is deleted.  The function
receives a pointer to the element and the user data pointer (&quot;d&quot;).

<pre>
void
free_cb(void *e, void *d)
{
  ... &quot;e&quot; is the element, &quot;d&quot; is the user data pointer
}
</pre>
</p>
<h3 class="function"><a id="cupsArrayNewStrings">cupsArrayNewStrings</a></h3>
<p class="description">Create a new array of delimited strings.</p>
<p class="code">
<a href="#cups_array_t">cups_array_t</a> *cupsArrayNewStrings(<span class="reserved">const</span> <span class="reserved">char</span> *s, <span class="reserved">char</span> delim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">Delimited strings or <code>NULL</code> to create an empty array</td></tr>
<tr><th>delim</th>
<td class="description">Delimiter character</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Array</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates an array that holds zero or more strings.  The created
array automatically manages copies of the strings passed and sorts them in
ascending order using a case-sensitive comparison.  If the string pointer &quot;s&quot;
is <code>NULL</code> or the empty string, no strings are added to the newly created
array.<br>
<br>
Additional strings can be added using the <a href="#cupsArrayAdd"><code>cupsArrayAdd</code></a> or
<a href="#cupsArrayAddStrings"><code>cupsArrayAddStrings</code></a> functions.</p>
<h3 class="function"><a id="cupsArrayRemove">cupsArrayRemove</a></h3>
<p class="description">Remove an element from an array.</p>
<p class="code">
<span class="reserved">bool</span> cupsArrayRemove(<a href="#cups_array_t">cups_array_t</a> *a, <span class="reserved">void</span> *e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
<tr><th>e</th>
<td class="description">Element</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function removes an element from an array.  If more than one element
matches &quot;e&quot;, only the first matching element is removed.</p>
<h3 class="function"><a id="cupsArrayRestore">cupsArrayRestore</a></h3>
<p class="description">Reset the current element to the last <a href="#cupsArraySave"><code>cupsArraySave</code></a>.</p>
<p class="code">
<span class="reserved">void</span> *cupsArrayRestore(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New current element</p>
<h3 class="function"><a id="cupsArraySave">cupsArraySave</a></h3>
<p class="description">Mark the current element for a later <a href="#cupsArrayRestore"><code>cupsArrayRestore</code></a>.</p>
<p class="code">
<span class="reserved">bool</span> cupsArraySave(<a href="#cups_array_t">cups_array_t</a> *a);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>a</th>
<td class="description">Array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
<a href="#cupsArrayGetElement"><code>cupsArrayGetElement</code></a>, <a href="#cupsArrayGetFirst"><code>cupsArrayGetFirst</code></a>, or
<a href="#cupsArrayGetLast"><code>cupsArrayGetLast</code></a> to set the current element.<br>
<br>
The save/restore stack is guaranteed to be at least 32 elements deep.</p>
<h3 class="function"><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
<p class="description">Cancel a job on a destination.</p>
<p class="code">
ipp_status_t cupsCancelDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <span class="reserved">int</span> job_id);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of cancel operation</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function cancels the specified job.  The &quot;dest&quot; argument is the name
of the destination printer while the &quot;job_id&quot; is the number returned by
<a href="#cupsCreateDestJob"><code>cupsCreateDestJob</code></a>.<br>
<br>
Returns <code>IPP_STATUS_OK</code> on success and
<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.</p>
<h3 class="function"><a id="cupsCharsetToUTF8">cupsCharsetToUTF8</a></h3>
<p class="description">Convert legacy character set to UTF-8.</p>
<p class="code">
ssize_t cupsCharsetToUTF8(<span class="reserved">char</span> *dest, <span class="reserved">const</span> <span class="reserved">char</span> *src, <span class="reserved">const</span> size_t maxout, <span class="reserved">const</span> cups_encoding_t encoding);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Target string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>maxout</th>
<td class="description">Max output size in bytes</td></tr>
<tr><th>encoding</th>
<td class="description">Encoding</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes or <code>-1</code> on error</p>
<h3 class="function"><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
<p class="description">Check that the option and value are supported
                             by the destination.</p>
<p class="code">
<span class="reserved">bool</span> cupsCheckDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option</td></tr>
<tr><th>value</th>
<td class="description">Value or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if supported, <code>false</code> if not</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns 1 if supported, 0 otherwise.</p>
<h3 class="function"><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
<p class="description">Close a job and start printing.</p>
<p class="code">
ipp_status_t cupsCloseDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, <span class="reserved">int</span> job_id);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function closes a job and starts printing.  Use when the last call to
<a href="#cupsStartDestDocument"><code>cupsStartDestDocument</code></a> passed <code>false</code> for &quot;last_document&quot;.  &quot;job_id&quot;
is the job ID returned by <a href="#cupsCreateDestJob"><code>cupsCreateDestJob</code></a>.  Returns <code>IPP_STATUS_OK</code>
on success.</p>
<h3 class="function"><a id="cupsConcatString">cupsConcatString</a></h3>
<p class="description">Safely concatenate two UTF-8 strings.</p>
<p class="code">
size_t cupsConcatString(<span class="reserved">char</span> *dst, <span class="reserved">const</span> <span class="reserved">char</span> *src, size_t dstsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>dstsize</th>
<td class="description">Size of destination string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Length of string</p>
<h3 class="function"><a id="cupsCondBroadcast">cupsCondBroadcast</a></h3>
<p class="description">Wake up waiting threads.</p>
<p class="code">
<span class="reserved">void</span> cupsCondBroadcast(<a href="#cups_cond_t">cups_cond_t</a> *cond);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cond</th>
<td class="description">Condition</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsCondDestroy">cupsCondDestroy</a></h3>
<p class="description">Destroy a condition variable.</p>
<p class="code">
<span class="reserved">void</span> cupsCondDestroy(<a href="#cups_cond_t">cups_cond_t</a> *cond);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cond</th>
<td class="description">Condition</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsCondInit">cupsCondInit</a></h3>
<p class="description">Initialize a condition variable.</p>
<p class="code">
<span class="reserved">void</span> cupsCondInit(<a href="#cups_cond_t">cups_cond_t</a> *cond);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cond</th>
<td class="description">Condition</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsCondWait">cupsCondWait</a></h3>
<p class="description">Wait for a condition with optional timeout.</p>
<p class="code">
<span class="reserved">void</span> cupsCondWait(<a href="#cups_cond_t">cups_cond_t</a> *cond, <a href="#cups_mutex_t">cups_mutex_t</a> *mutex, <span class="reserved">double</span> timeout);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cond</th>
<td class="description">Condition</td></tr>
<tr><th>mutex</th>
<td class="description">Mutex</td></tr>
<tr><th>timeout</th>
<td class="description">Timeout in seconds (<code>0</code> or negative for none)</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsConnectDest">cupsConnectDest</a></h3>
<p class="description">Open a connection to the destination.</p>
<p class="code">
<a href="#http_t">http_t</a> *cupsConnectDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, <span class="reserved">unsigned</span> flags, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel, <span class="reserved">char</span> *resource, size_t resourcesize, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, <span class="reserved">void</span> *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>flags</th>
<td class="description">Connection flags</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
<tr><th>resource</th>
<td class="description">Resource buffer</td></tr>
<tr><th>resourcesize</th>
<td class="description">Size of resource buffer</td></tr>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connection to destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
and optionally the resource path to use for the destination.  These calls
will block until a connection is made, the timeout expires, the integer
pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
returns <code>0</code>.  The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
returned connection.<br>
<br>
The caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code> for the &quot;flags&quot; argument to
connect directly to the device associated with the destination.  Otherwise,
the connection is made to the CUPS scheduler associated with the destination.</p>
<h3 class="function"><a id="cupsCopyCredentials">cupsCopyCredentials</a></h3>
<p class="description"></p>
<p class="code">
<span class="reserved">char</span> *cupsCopyCredentials(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Copy the X.509 certificate chain to a string.</p>
<h3 class="function"><a id="cupsCopyCredentialsKey">cupsCopyCredentialsKey</a></h3>
<p class="description"></p>
<p class="code">
<span class="reserved">char</span> *cupsCopyCredentialsKey(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Copy the private key to a string.</p>
<h3 class="function"><a id="cupsCopyCredentialsRequest">cupsCopyCredentialsRequest</a></h3>
<p class="description"></p>
<p class="code">
<span class="reserved">char</span> *cupsCopyCredentialsRequest(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Copy the X.509 certificate signing request to a string.</p>
<h3 class="function"><a id="cupsCopyDest">cupsCopyDest</a></h3>
<p class="description">Copy a destination.</p>
<p class="code">
size_t cupsCopyDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Destination to copy</td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destination array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Make a copy of the destination to an array of destinations (or just a single
copy) - for use with the <code>cupsEnumDests*</code> functions. The caller is
responsible for calling <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> on the returned object(s).</p>
<h3 class="function"><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
<p class="description">Get conflicts and resolutions for a new
                            option/value pair.</p>
<p class="code">
<span class="reserved">int</span> cupsCopyDestConflicts(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options, <span class="reserved">const</span> <span class="reserved">char</span> *new_option, <span class="reserved">const</span> <span class="reserved">char</span> *new_value, size_t *num_conflicts, <a href="#cups_option_t">cups_option_t</a> **conflicts, size_t *num_resolved, <a href="#cups_option_t">cups_option_t</a> **resolved);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>num_options</th>
<td class="description">Number of current options</td></tr>
<tr><th>options</th>
<td class="description">Current options</td></tr>
<tr><th>new_option</th>
<td class="description">New option</td></tr>
<tr><th>new_value</th>
<td class="description">New value</td></tr>
<tr><th>num_conflicts</th>
<td class="description">Number of conflicting options</td></tr>
<tr><th>conflicts</th>
<td class="description">Conflicting options</td></tr>
<tr><th>num_resolved</th>
<td class="description">Number of options to resolve</td></tr>
<tr><th>resolved</th>
<td class="description">Resolved options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
user.  &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
changed.<br>
<br>
Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
there was an unrecoverable error such as a resolver loop.<br>
<br>
If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
contain the list of conflicting option/value pairs.  Similarly, if
&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
list of changes needed to resolve the conflict.<br>
<br>
If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.</p>
<h3 class="function"><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
<p class="description">Get the supported values/capabilities for the
                       destination.</p>
<p class="code">
<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dest_flags_t">cups_dest_flags_t</a> dflags);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dflags</th>
<td class="description">Destination flags</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination information</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
value. <code>NULL</code> is returned on error.</p>
<h3 class="function"><a id="cupsCopyString">cupsCopyString</a></h3>
<p class="description">Safely copy a UTF-8 string.</p>
<p class="code">
size_t cupsCopyString(<span class="reserved">char</span> *dst, <span class="reserved">const</span> <span class="reserved">char</span> *src, size_t dstsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>dstsize</th>
<td class="description">Size of destination string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Length of string</p>
<h3 class="function"><a id="cupsCreateCredentials">cupsCreateCredentials</a></h3>
<p class="description">Make an X.509 certificate and private key pair.</p>
<p class="code">
<span class="reserved">bool</span> cupsCreateCredentials(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">bool</span> ca_cert, <a href="#cups_credpurpose_t">cups_credpurpose_t</a> purpose, <a href="#cups_credtype_t">cups_credtype_t</a> type, <a href="#cups_credusage_t">cups_credusage_t</a> usage, <span class="reserved">const</span> <span class="reserved">char</span> *organization, <span class="reserved">const</span> <span class="reserved">char</span> *org_unit, <span class="reserved">const</span> <span class="reserved">char</span> *locality, <span class="reserved">const</span> <span class="reserved">char</span> *state_province, <span class="reserved">const</span> <span class="reserved">char</span> *country, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *email, size_t num_alt_names, <span class="reserved">const</span> <span class="reserved">char</span> *const *alt_names, <span class="reserved">const</span> <span class="reserved">char</span> *root_name, time_t expiration_date);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>ca_cert</th>
<td class="description"><code>true</code> to create a CA certificate, <code>false</code> for a client/server certificate</td></tr>
<tr><th>purpose</th>
<td class="description">Credential purposes</td></tr>
<tr><th>type</th>
<td class="description">Credential type</td></tr>
<tr><th>usage</th>
<td class="description">Credential usages</td></tr>
<tr><th>organization</th>
<td class="description">Organization or <code>NULL</code> to use common name</td></tr>
<tr><th>org_unit</th>
<td class="description">Organizational unit or <code>NULL</code> for none</td></tr>
<tr><th>locality</th>
<td class="description">City/town or <code>NULL</code> for &quot;Unknown&quot;</td></tr>
<tr><th>state_province</th>
<td class="description">State/province or <code>NULL</code> for &quot;Unknown&quot;</td></tr>
<tr><th>country</th>
<td class="description">Country or <code>NULL</code> for locale-based default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
<tr><th>email</th>
<td class="description">Email address or <code>NULL</code> for none</td></tr>
<tr><th>num_alt_names</th>
<td class="description">Number of subject alternate names</td></tr>
<tr><th>alt_names</th>
<td class="description">Subject Alternate Names</td></tr>
<tr><th>root_name</th>
<td class="description">Root certificate/domain name or <code>NULL</code> for site/self-signed</td></tr>
<tr><th>expiration_date</th>
<td class="description">Expiration date</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates an X.509 certificate and private key pair.  The
certificate and key are stored in the directory &quot;path&quot; or, if &quot;path&quot; is
<code>NULL</code>, in a per-user or system-wide (when running as root) certificate/key
store.  The generated certificate is signed by the named root certificate or,
if &quot;root_name&quot; is <code>NULL</code>, a site-wide default root certificate.  When
&quot;root_name&quot; is <code>NULL</code> and there is no site-wide default root certificate, a
self-signed certificate is generated instead.<br>
<br>
The &quot;ca_cert&quot; argument specifies whether a CA certificate should be created.<br>
<br>
The &quot;purpose&quot; argument specifies the purpose(s) used for the credentials as a
bitwise OR of the following constants:

</p><ul>
<li><code>CUPS_CREDPURPOSE_SERVER_AUTH</code> for validating TLS servers,
</li>
<li><code>CUPS_CREDPURPOSE_CLIENT_AUTH</code> for validating TLS clients,
</li>
<li><code>CUPS_CREDPURPOSE_CODE_SIGNING</code> for validating compiled code,
</li>
<li><code>CUPS_CREDPURPOSE_EMAIL_PROTECTION</code> for validating email messages,
</li>
<li><code>CUPS_CREDPURPOSE_TIME_STAMPING</code> for signing timestamps to objects, and/or
</li>
<li><code>CUPS_CREDPURPOSE_OCSP_SIGNING</code> for Online Certificate Status Protocol
  message signing.</li>
</ul>
<p class="discussion">The &quot;type&quot; argument specifies the type of credentials using one of the
following constants:

</p><ul>
<li><code>CUPS_CREDTYPE_DEFAULT</code>: default type (RSA-3072 or P-384),
</li>
<li><code>CUPS_CREDTYPE_RSA_2048_SHA256</code>: RSA with 2048-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_RSA_3072_SHA256</code>: RSA with 3072-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_RSA_4096_SHA256</code>: RSA with 4096-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P256_SHA256</code>: ECDSA using the P-256 curve with SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P384_SHA256</code>: ECDSA using the P-384 curve with SHA-256 hash, or
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P521_SHA256</code>: ECDSA using the P-521 curve with SHA-256 hash.</li>
</ul>
<p class="discussion">The &quot;usage&quot; argument specifies the usage(s) for the credentials as a bitwise
OR of the following constants:

</p><ul>
<li><code>CUPS_CREDUSAGE_DIGITAL_SIGNATURE</code>: digital signatures,
</li>
<li><code>CUPS_CREDUSAGE_NON_REPUDIATION</code>: non-repudiation/content commitment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_ENCIPHERMENT</code>: key encipherment,
</li>
<li><code>CUPS_CREDUSAGE_DATA_ENCIPHERMENT</code>: data encipherment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_AGREEMENT</code>: key agreement,
</li>
<li><code>CUPS_CREDUSAGE_KEY_CERT_SIGN</code>: key certicate signing,
</li>
<li><code>CUPS_CREDUSAGE_CRL_SIGN</code>: certificate revocation list signing,
</li>
<li><code>CUPS_CREDUSAGE_ENCIPHER_ONLY</code>: encipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DECIPHER_ONLY</code>: decipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_CA</code>: defaults for CA certificates,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_TLS</code>: defaults for TLS certificates, and/or
</li>
<li><code>CUPS_CREDUSAGE_ALL</code>: all usages.</li>
</ul>
<p class="discussion">The &quot;organization&quot;, &quot;org_unit&quot;, &quot;locality&quot;, &quot;state_province&quot;, and &quot;country&quot;
arguments specify information about the identity and geolocation of the
issuer.<br>
<br>
The &quot;common_name&quot; argument specifies the common name and the &quot;num_alt_names&quot;
and &quot;alt_names&quot; arguments specify a list of DNS hostnames for the
certificate.<br>
<br>
The &quot;expiration_date&quot; argument specifies the expiration date and time as a
Unix <code>time_t</code> value in seconds.</p>
<h3 class="function"><a id="cupsCreateCredentialsRequest">cupsCreateCredentialsRequest</a></h3>
<p class="description">Make an X.509 Certificate Signing Request.</p>
<p class="code">
<span class="reserved">bool</span> cupsCreateCredentialsRequest(<span class="reserved">const</span> <span class="reserved">char</span> *path, <a href="#cups_credpurpose_t">cups_credpurpose_t</a> purpose, <a href="#cups_credtype_t">cups_credtype_t</a> type, <a href="#cups_credusage_t">cups_credusage_t</a> usage, <span class="reserved">const</span> <span class="reserved">char</span> *organization, <span class="reserved">const</span> <span class="reserved">char</span> *org_unit, <span class="reserved">const</span> <span class="reserved">char</span> *locality, <span class="reserved">const</span> <span class="reserved">char</span> *state_province, <span class="reserved">const</span> <span class="reserved">char</span> *country, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *email, size_t num_alt_names, <span class="reserved">const</span> <span class="reserved">char</span> *const *alt_names);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>purpose</th>
<td class="description">Credential purposes</td></tr>
<tr><th>type</th>
<td class="description">Credential type</td></tr>
<tr><th>usage</th>
<td class="description">Credential usages</td></tr>
<tr><th>organization</th>
<td class="description">Organization or <code>NULL</code> to use common name</td></tr>
<tr><th>org_unit</th>
<td class="description">Organizational unit or <code>NULL</code> for none</td></tr>
<tr><th>locality</th>
<td class="description">City/town or <code>NULL</code> for &quot;Unknown&quot;</td></tr>
<tr><th>state_province</th>
<td class="description">State/province or <code>NULL</code> for &quot;Unknown&quot;</td></tr>
<tr><th>country</th>
<td class="description">Country or <code>NULL</code> for locale-based default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
<tr><th>email</th>
<td class="description">Email address or <code>NULL</code> for none</td></tr>
<tr><th>num_alt_names</th>
<td class="description">Number of subject alternate names</td></tr>
<tr><th>alt_names</th>
<td class="description">Subject Alternate Names</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates an X.509 certificate signing request (CSR) and
associated private key.  The CSR and key are stored in the directory &quot;path&quot;
or, if &quot;path&quot; is <code>NULL</code>, in a per-user or system-wide (when running as root)
certificate/key store.<br>
<br>
The &quot;purpose&quot; argument specifies the purpose(s) used for the credentials as a
bitwise OR of the following constants:

</p><ul>
<li><code>CUPS_CREDPURPOSE_SERVER_AUTH</code> for validating TLS servers,
</li>
<li><code>CUPS_CREDPURPOSE_CLIENT_AUTH</code> for validating TLS clients,
</li>
<li><code>CUPS_CREDPURPOSE_CODE_SIGNING</code> for validating compiled code,
</li>
<li><code>CUPS_CREDPURPOSE_EMAIL_PROTECTION</code> for validating email messages,
</li>
<li><code>CUPS_CREDPURPOSE_TIME_STAMPING</code> for signing timestamps to objects, and/or
</li>
<li><code>CUPS_CREDPURPOSE_OCSP_SIGNING</code> for Online Certificate Status Protocol
  message signing.</li>
</ul>
<p class="discussion">The &quot;type&quot; argument specifies the type of credentials using one of the
following constants:

</p><ul>
<li><code>CUPS_CREDTYPE_DEFAULT</code>: default type (RSA-3072 or P-384),
</li>
<li><code>CUPS_CREDTYPE_RSA_2048_SHA256</code>: RSA with 2048-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_RSA_3072_SHA256</code>: RSA with 3072-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_RSA_4096_SHA256</code>: RSA with 4096-bit keys and SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P256_SHA256</code>: ECDSA using the P-256 curve with SHA-256 hash,
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P384_SHA256</code>: ECDSA using the P-384 curve with SHA-256 hash, or
</li>
<li><code>CUPS_CREDTYPE_ECDSA_P521_SHA256</code>: ECDSA using the P-521 curve with SHA-256 hash.</li>
</ul>
<p class="discussion">The &quot;usage&quot; argument specifies the usage(s) for the credentials as a bitwise
OR of the following constants:

</p><ul>
<li><code>CUPS_CREDUSAGE_DIGITAL_SIGNATURE</code>: digital signatures,
</li>
<li><code>CUPS_CREDUSAGE_NON_REPUDIATION</code>: non-repudiation/content commitment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_ENCIPHERMENT</code>: key encipherment,
</li>
<li><code>CUPS_CREDUSAGE_DATA_ENCIPHERMENT</code>: data encipherment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_AGREEMENT</code>: key agreement,
</li>
<li><code>CUPS_CREDUSAGE_KEY_CERT_SIGN</code>: key certicate signing,
</li>
<li><code>CUPS_CREDUSAGE_CRL_SIGN</code>: certificate revocation list signing,
</li>
<li><code>CUPS_CREDUSAGE_ENCIPHER_ONLY</code>: encipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DECIPHER_ONLY</code>: decipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_CA</code>: defaults for CA certificates,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_TLS</code>: defaults for TLS certificates, and/or
</li>
<li><code>CUPS_CREDUSAGE_ALL</code>: all usages.</li>
</ul>
<p class="discussion">The &quot;organization&quot;, &quot;org_unit&quot;, &quot;locality&quot;, &quot;state_province&quot;, and &quot;country&quot;
arguments specify information about the identity and geolocation of the
issuer.<br>
<br>
The &quot;common_name&quot; argument specifies the common name and the &quot;num_alt_names&quot;
and &quot;alt_names&quot; arguments specify a list of DNS hostnames for the
certificate.</p>
<h3 class="function"><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
<p class="description">Create a job on a destination.</p>
<p class="code">
ipp_status_t cupsCreateDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, <span class="reserved">int</span> *job_id, <span class="reserved">const</span> <span class="reserved">char</span> *title, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID or <code>0</code> on error</td></tr>
<tr><th>title</th>
<td class="description">Job name</td></tr>
<tr><th>num_options</th>
<td class="description">Number of job options</td></tr>
<tr><th>options</th>
<td class="description">Job options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a job on the specified destination &quot;dest&quot;.  The &quot;info&quot;
argument contains information about the destination obtained using the
<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a> function.<br>
<br>
The &quot;job_id&quot; argument provides an integer to hold the new job's ID number.
The &quot;title&quot; argument provides the title of the job.  The &quot;num_options&quot; and
&quot;options&quot; arguments provide an array of job options for the job.<br>
<br>
Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
in the variable pointed to by &quot;job_id&quot;.</p>
<h3 class="function"><a id="cupsCreateTempFd">cupsCreateTempFd</a></h3>
<p class="description">Creates a temporary file.</p>
<p class="code">
<span class="reserved">int</span> cupsCreateTempFd(<span class="reserved">const</span> <span class="reserved">char</span> *prefix, <span class="reserved">const</span> <span class="reserved">char</span> *suffix, <span class="reserved">char</span> *filename, size_t len);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>prefix</th>
<td class="description">Filename prefix or <code>NULL</code> for none</td></tr>
<tr><th>suffix</th>
<td class="description">Filename suffix or <code>NULL</code> for none</td></tr>
<tr><th>filename</th>
<td class="description">Pointer to buffer</td></tr>
<tr><th>len</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New file descriptor or <code>-1</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a temporary file and returns a file descriptor for the
file.  The unique temporary filename uses the &quot;prefix&quot; and &quot;suffix&quot; arguments
and is returned in the filename buffer.  The temporary file is opened for
reading and writing.</p>
<h3 class="function"><a id="cupsCreateTempFile">cupsCreateTempFile</a></h3>
<p class="description">Creates a temporary CUPS file.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsCreateTempFile(<span class="reserved">const</span> <span class="reserved">char</span> *prefix, <span class="reserved">const</span> <span class="reserved">char</span> *suffix, <span class="reserved">char</span> *filename, size_t len);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>prefix</th>
<td class="description">Filename prefix or <code>NULL</code> for none</td></tr>
<tr><th>suffix</th>
<td class="description">Filename suffix or <code>NULL</code> for none</td></tr>
<tr><th>filename</th>
<td class="description">Pointer to buffer</td></tr>
<tr><th>len</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a temporary file and returns a file descriptor for the
file.  The unique temporary filename uses the &quot;prefix&quot; and &quot;suffix&quot; arguments
and is returned in the filename buffer.  The temporary file is opened for
writing.</p>
<h3 class="function"><a id="cupsDNSSDAssembleFullName">cupsDNSSDAssembleFullName</a></h3>
<p class="description">Create a full service name from the instance
                                name, registration type, and domain.</p>
<p class="code">
<span class="reserved">bool</span> cupsDNSSDAssembleFullName(<span class="reserved">char</span> *fullname, size_t fullsize, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *type, <span class="reserved">const</span> <span class="reserved">char</span> *domain);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fullname</th>
<td class="description">Buffer for full name</td></tr>
<tr><th>fullsize</th>
<td class="description">Size of buffer</td></tr>
<tr><th>name</th>
<td class="description">Service instance name</td></tr>
<tr><th>type</th>
<td class="description">Registration type</td></tr>
<tr><th>domain</th>
<td class="description">Domain</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function combines an instance name (&quot;Example Name&quot;), registration type
(&quot;_ipp._tcp&quot;), and domain (&quot;local.&quot;) to create a properly escaped full
service name (&quot;Example032Name._ipp._tcp.local.&quot;).</p>
<h3 class="function"><a id="cupsDNSSDBrowseDelete">cupsDNSSDBrowseDelete</a></h3>
<p class="description">Cancel and delete a browse request.</p>
<p class="code">
<span class="reserved">void</span> cupsDNSSDBrowseDelete(<a href="#cups_dnssd_browse_t">cups_dnssd_browse_t</a> *browse);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>browse</th>
<td class="description">Browse request</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDNSSDBrowseGetContext">cupsDNSSDBrowseGetContext</a></h3>
<p class="description">Get the DNS-SD context for the browse request.</p>
<p class="code">
<a href="#cups_dnssd_t">cups_dnssd_t</a> *cupsDNSSDBrowseGetContext(<a href="#cups_dnssd_browse_t">cups_dnssd_browse_t</a> *browse);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>browse</th>
<td class="description">Browse request</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Context or <code>NULL</code></p>
<h3 class="function"><a id="cupsDNSSDBrowseNew">cupsDNSSDBrowseNew</a></h3>
<p class="description">Create a new DNS-SD browse request.</p>
<p class="code">
<a href="#cups_dnssd_browse_t">cups_dnssd_browse_t</a> *cupsDNSSDBrowseNew(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, uint32_t if_index, <span class="reserved">const</span> <span class="reserved">char</span> *types, <span class="reserved">const</span> <span class="reserved">char</span> *domain, <a href="#cups_dnssd_browse_cb_t">cups_dnssd_browse_cb_t</a> browse_cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>if_index</th>
<td class="description">Interface index, <code>CUPS_DNSSD_IF_INDEX_ANY</code>, or <code>CUPS_DNSSD_IF_INDEX_LOCAL</code></td></tr>
<tr><th>types</th>
<td class="description">Service types</td></tr>
<tr><th>domain</th>
<td class="description">Domain name or <code>NULL</code> for default</td></tr>
<tr><th>browse_cb</th>
<td class="description">Browse callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Browse callback data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Browse request or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new DNS-SD browse request for the specified service
types and optional domain and interface index.  The &quot;types&quot; argument can be a
single service type (&quot;_ipp._tcp&quot;) or a service type and comma-delimited list
of sub-types (&quot;_ipp._tcp,_print,_universal&quot;).<br>
<br>
Newly discovered services are reported using the required browse callback
function, with the &quot;flags&quot; argument set to <code>CUPS_DNSSD_FLAGS_ADD</code> for newly
discovered services, <code>CUPS_DNSSD_FLAGS_NONE</code> for removed services, or
<code>CUPS_DNSSD_FLAGS_ERROR</code> on an error:

<pre>
void
browse_cb(
    cups_dnssd_browse_t *browse,
    void                *cb_data,
    cups_dnssd_flags_t  flags,
    uint32_t            if_index,
    const char          *name,
    const char          *regtype,
    const char          *domain)
{
    // Process added/removed service
}
</pre>
</p>
<h3 class="function"><a id="cupsDNSSDCopyComputerName">cupsDNSSDCopyComputerName</a></h3>
<p class="description">Copy the current human-readable name for the system.</p>
<p class="code">
<span class="reserved">char</span> *cupsDNSSDCopyComputerName(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>buffer</th>
<td class="description">Computer name buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of computer name buffer (at least 128 bytes)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Computer name or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies the current human-readable name (&quot;My Computer&quot;) to the
provided buffer.  The &quot;dnssd&quot; parameter is a DNS-SD context created with
<a href="#cupsDNSSDNew"><code>cupsDNSSDNew</code></a>.  The &quot;buffer&quot; parameter points to a character array of
at least 128 bytes and the &quot;bufsize&quot; parameter specifies the actual size of
the array.</p>
<h3 class="function"><a id="cupsDNSSDCopyHostName">cupsDNSSDCopyHostName</a></h3>
<p class="description">Copy the current mDNS hostname for the system.</p>
<p class="code">
<span class="reserved">char</span> *cupsDNSSDCopyHostName(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>buffer</th>
<td class="description">Hostname buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of hostname buffer (at least 70 bytes)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">mDNS hostname or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies the current mDNS hostname (&quot;hostname.local&quot;) to the
provided buffer.  The &quot;dnssd&quot; parameter is a DNS-SD context created with
<a href="#cupsDNSSDNew"><code>cupsDNSSDNew</code></a>.  The &quot;buffer&quot; parameter points to a character array of
at least 70 bytes and the &quot;bufsize&quot; parameter specifies the actual size of
the array.</p>
<h3 class="function"><a id="cupsDNSSDDecodeTXT">cupsDNSSDDecodeTXT</a></h3>
<p class="description">Decode a TXT record into key/value pairs.</p>
<p class="code">
size_t cupsDNSSDDecodeTXT(<span class="reserved">const</span> <span class="reserved">unsigned</span> <span class="reserved">char</span> *txtrec, uint16_t txtlen, <a href="#cups_option_t">cups_option_t</a> **txt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>txtrec</th>
<td class="description">TXT record data</td></tr>
<tr><th>txtlen</th>
<td class="description">TXT record length</td></tr>
<tr><th>txt</th>
<td class="description">Key/value pairs</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of key/value pairs</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts the DNS TXT record encoding of key/value pairs into
<code>cups_option_t</code> elements that can be accessed using the <a href="#cupsGetOption"><code>cupsGetOption</code></a>
function and freed using the <a href="#cupsFreeOptions"><code>cupsFreeOptions</code></a> function.</p>
<h3 class="function"><a id="cupsDNSSDDelete">cupsDNSSDDelete</a></h3>
<p class="description">Delete a DNS-SD context and all its requests.</p>
<p class="code">
<span class="reserved">void</span> cupsDNSSDDelete(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDNSSDGetConfigChanges">cupsDNSSDGetConfigChanges</a></h3>
<p class="description">Get the number of host name/network
                                configuration changes seen.</p>
<p class="code">
size_t cupsDNSSDGetConfigChanges(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of host name changes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the number of host name or network configuration
changes that have been seen since the context was created.  The value can be
used to track when local services need to be updated.  Registered services
will also get a callback with the <code>CUPS_DNSSD_FLAGS_HOST_CHANGE</code> bit set in
the &quot;flags&quot; argument for host name changes and/or
<code>CUPS_DNSSD_FLAGS_NETWORK_CHANGE</code> for network changes.</p>
<h3 class="function"><a id="cupsDNSSDNew">cupsDNSSDNew</a></h3>
<p class="description">Create a new DNS-SD context.</p>
<p class="code">
<a href="#cups_dnssd_t">cups_dnssd_t</a> *cupsDNSSDNew(<a href="#cups_dnssd_error_cb_t">cups_dnssd_error_cb_t</a> error_cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>error_cb</th>
<td class="description">Error callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Error callback data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">DNS-SD context</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new DNS-SD context for browsing, querying, resolving,
and/or registering services.  Call <a href="#cupsDNSSDDelete"><code>cupsDNSSDDelete</code></a> to stop any pending
browses, queries, or resolves, unregister any services, and free the DNS-SD
context.</p>
<h3 class="function"><a id="cupsDNSSDQueryDelete">cupsDNSSDQueryDelete</a></h3>
<p class="description">Cancel and delete a query request.</p>
<p class="code">
<span class="reserved">void</span> cupsDNSSDQueryDelete(<a href="#cups_dnssd_query_t">cups_dnssd_query_t</a> *query);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>query</th>
<td class="description">Query request</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDNSSDQueryGetContext">cupsDNSSDQueryGetContext</a></h3>
<p class="description">Get the DNS-SD context for the query request.</p>
<p class="code">
<a href="#cups_dnssd_t">cups_dnssd_t</a> *cupsDNSSDQueryGetContext(<a href="#cups_dnssd_query_t">cups_dnssd_query_t</a> *query);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>query</th>
<td class="description">Query request</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">DNS-SD context or <code>NULL</code></p>
<h3 class="function"><a id="cupsDNSSDQueryNew">cupsDNSSDQueryNew</a></h3>
<p class="description">Create a new query request.</p>
<p class="code">
<a href="#cups_dnssd_query_t">cups_dnssd_query_t</a> *cupsDNSSDQueryNew(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, uint32_t if_index, <span class="reserved">const</span> <span class="reserved">char</span> *fullname, uint16_t rrtype, <a href="#cups_dnssd_query_cb_t">cups_dnssd_query_cb_t</a> query_cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>if_index</th>
<td class="description">Interface index or <code>CUPS_DNSSD_IF_INDEX_ANY</code> or <code>CUPS_DNSSD_IF_INDEX_LOCAL</code></td></tr>
<tr><th>fullname</th>
<td class="description">Full DNS name including types and domain</td></tr>
<tr><th>rrtype</th>
<td class="description">Record type to query (<code>CUPS_DNSSD_RRTYPE_TXT</code>, etc.)</td></tr>
<tr><th>query_cb</th>
<td class="description">Query callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Query callback data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Query request or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new DNS-SD query request for the specified full
service name and DNS record type.  The &quot;fullname&quot; parameter specifies the
full DNS name of the service (instance name, type, and domain) being queried.
Responses to the query are reported using the required query callback
function with the &quot;flags&quot; argument set to <code>CUPS_DNSSD_FLAGS_NONE</code> on success
or <code>CUPS_DNSSD_FLAGS_ERROR</code> on error:

<pre>
void
query_cb(
    cups_dnssd_query_t *query,
    void               *cb_data,
    cups_dnssd_flags_t flags,
    uint32_t           if_index,
    const char         *fullname,
    uint16_t           rrtype,
    const void         *qdata,
    uint16_t           qlen)
{
    // Process query record
}
</pre>
</p>
<h3 class="function"><a id="cupsDNSSDResolveDelete">cupsDNSSDResolveDelete</a></h3>
<p class="description">Cancel and free a resolve request.</p>
<p class="code">
<span class="reserved">void</span> cupsDNSSDResolveDelete(<a href="#cups_dnssd_resolve_t">cups_dnssd_resolve_t</a> *res);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>res</th>
<td class="description">Resolve request</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDNSSDResolveGetContext">cupsDNSSDResolveGetContext</a></h3>
<p class="description">Get the DNS-SD context for the resolve request.</p>
<p class="code">
<a href="#cups_dnssd_t">cups_dnssd_t</a> *cupsDNSSDResolveGetContext(<a href="#cups_dnssd_resolve_t">cups_dnssd_resolve_t</a> *resolve);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>resolve</th>
<td class="description">Resolve request</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">DNS-SD context or <code>NULL</code></p>
<h3 class="function"><a id="cupsDNSSDResolveNew">cupsDNSSDResolveNew</a></h3>
<p class="description">Create a new DNS-SD resolve request.</p>
<p class="code">
<a href="#cups_dnssd_resolve_t">cups_dnssd_resolve_t</a> *cupsDNSSDResolveNew(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, uint32_t if_index, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *type, <span class="reserved">const</span> <span class="reserved">char</span> *domain, <a href="#cups_dnssd_resolve_cb_t">cups_dnssd_resolve_cb_t</a> resolve_cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>if_index</th>
<td class="description">Interface index or <code>CUPS_DNSSD_IF_INDEX_ANY</code> or <code>CUPS_DNSSD_IF_INDEX_LOCAL</code></td></tr>
<tr><th>name</th>
<td class="description">Service name</td></tr>
<tr><th>type</th>
<td class="description">Service type</td></tr>
<tr><th>domain</th>
<td class="description">Domain name or <code>NULL</code> for default</td></tr>
<tr><th>resolve_cb</th>
<td class="description">Resolve callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Resolve callback data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Resolve request or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new DNS-SD resolver for the specified instance name,
service type, and optional domain and interface index.  Resikved services
are reported using the required resolve callback function, with the &quot;flags&quot;
argument set to <code>CUPS_DNSSD_FLAGS_NONE</code> on success or
<code>CUPS_DNSSD_FLAGS_ERROR</code> on error:

<pre>
void
resolve_cb(
    cups_dnssd_resolve_t *resolve,
    void                 *cb_data,
    cups_dnssd_flags_t   flags,
    uint32_t             if_index,
    const char           *fullname,
    const char           *host,
    uint16_t             port,
    size_t               num_txt,
    cups_option_t        *txt)
{
    // Process resolved service
}
</pre>
</p>
<h3 class="function"><a id="cupsDNSSDSeparateFullName">cupsDNSSDSeparateFullName</a></h3>
<p class="description">Separate a full service name into an instance
                                name, registration type, and domain.</p>
<p class="code">
<span class="reserved">bool</span> cupsDNSSDSeparateFullName(<span class="reserved">const</span> <span class="reserved">char</span> *fullname, <span class="reserved">char</span> *name, size_t namesize, <span class="reserved">char</span> *type, size_t typesize, <span class="reserved">char</span> *domain, size_t domainsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fullname</th>
<td class="description">Full service name</td></tr>
<tr><th>name</th>
<td class="description">Instance name buffer</td></tr>
<tr><th>namesize</th>
<td class="description">Size of instance name buffer</td></tr>
<tr><th>type</th>
<td class="description">Registration type buffer</td></tr>
<tr><th>typesize</th>
<td class="description">Size of registration type buffer</td></tr>
<tr><th>domain</th>
<td class="description">Domain name buffer</td></tr>
<tr><th>domainsize</th>
<td class="description">Size of domain name buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function separates a full service name such as
&quot;Example032Name._ipp._tcp.local.&quot;) into its instance name (&quot;Example Name&quot;),
registration type (&quot;_ipp._tcp&quot;), and domain (&quot;local.&quot;).</p>
<h3 class="function"><a id="cupsDNSSDServiceAdd">cupsDNSSDServiceAdd</a></h3>
<p class="description">Add a service instance.</p>
<p class="code">
<span class="reserved">bool</span> cupsDNSSDServiceAdd(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service, <span class="reserved">const</span> <span class="reserved">char</span> *types, <span class="reserved">const</span> <span class="reserved">char</span> *domain, <span class="reserved">const</span> <span class="reserved">char</span> *host, uint16_t port, size_t num_txt, <a href="#cups_option_t">cups_option_t</a> *txt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service</td></tr>
<tr><th>types</th>
<td class="description">Service types</td></tr>
<tr><th>domain</th>
<td class="description">Domain name or <code>NULL</code> for default</td></tr>
<tr><th>host</th>
<td class="description">Host name or <code>NULL</code> for default</td></tr>
<tr><th>port</th>
<td class="description">Port number or <code>0</code> for none</td></tr>
<tr><th>num_txt</th>
<td class="description">Number of TXT record values</td></tr>
<tr><th>txt</th>
<td class="description">TXT record values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds a service instance for the specified service types,
domain, host, and port.  The &quot;types&quot; argument can be a single service type
(&quot;_ipp._tcp&quot;) or a service type and comma-delimited list of sub-types
(&quot;_ipp._tcp,_print,_universal&quot;).<br>
<br>
Call the <a href="#cupsDNSSDServicePublish"><code>cupsDNSSDServicePublish</code></a> function after all service instances
have been added.</p>
<h3 class="function"><a id="cupsDNSSDServiceDelete">cupsDNSSDServiceDelete</a></h3>
<p class="description">Cancel and free a service registration.</p>
<p class="code">
<span class="reserved">void</span> cupsDNSSDServiceDelete(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDNSSDServiceGetContext">cupsDNSSDServiceGetContext</a></h3>
<p class="description">Get the DNS-SD context for the service
                                 registration.</p>
<p class="code">
<a href="#cups_dnssd_t">cups_dnssd_t</a> *cupsDNSSDServiceGetContext(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service registration</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">DNS-SD context or <code>NULL</code></p>
<h3 class="function"><a id="cupsDNSSDServiceGetName">cupsDNSSDServiceGetName</a></h3>
<p class="description">Get the service instance name for the service registration.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsDNSSDServiceGetName(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service registration</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Service instance name</p>
<h3 class="function"><a id="cupsDNSSDServiceNew">cupsDNSSDServiceNew</a></h3>
<p class="description">Create a new named service.</p>
<p class="code">
<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *cupsDNSSDServiceNew(<a href="#cups_dnssd_t">cups_dnssd_t</a> *dnssd, uint32_t if_index, <span class="reserved">const</span> <span class="reserved">char</span> *name, <a href="#cups_dnssd_service_cb_t">cups_dnssd_service_cb_t</a> cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dnssd</th>
<td class="description">DNS-SD context</td></tr>
<tr><th>if_index</th>
<td class="description">Interface index, <code>CUPS_DNSSD_IF_INDEX_ANY</code>, or <code>CUPS_DNSSD_IF_INDEX_LOCAL</code></td></tr>
<tr><th>name</th>
<td class="description">Name of service</td></tr>
<tr><th>cb</th>
<td class="description">Service registration callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Service registration callback data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Service or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a new DNS-SD service registration for the given service
instance name and interface.  Specific services using the name are added
using the <a href="#cupsDNSSDServiceAdd"><code>cupsDNSSDServiceAdd</code></a> function.<br>
<br>
The required service callback is called for select events, with the &quot;flags&quot;
argument set to <code>CUPS_DNSSD_FLAGS_NONE</code> for a successful registration,
<code>CUPS_DNSSD_FLAGS_COLLISION</code> when there is a name collision, or
<code>CUPS_DNSSD_FLAGS_ERROR</code> when there is a problem completing the service
registration.</p>
<h3 class="function"><a id="cupsDNSSDServicePublish">cupsDNSSDServicePublish</a></h3>
<p class="description">Publish a service.</p>
<p class="code">
<span class="reserved">bool</span> cupsDNSSDServicePublish(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function publishes the DNS-SD services added using the
<a href="#cupsDNSSDServiceAdd"><code>cupsDNSSDServiceAdd</code></a> function.</p>
<h3 class="function"><a id="cupsDNSSDServiceSetLocation">cupsDNSSDServiceSetLocation</a></h3>
<p class="description">Set the geolocation (LOC record) of a
                                  service.</p>
<p class="code">
<span class="reserved">bool</span> cupsDNSSDServiceSetLocation(<a href="#cups_dnssd_service_t">cups_dnssd_service_t</a> *service, <span class="reserved">const</span> <span class="reserved">char</span> *geo_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>service</th>
<td class="description">Service</td></tr>
<tr><th>geo_uri</th>
<td class="description">Geolocation as a 'geo:' URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the geolocation of a service using a 'geo:' URI (RFC 5870)
of the form
'geo:LATITUDE,LONGITUDE[,ALTITUDE][;crs=CRSLABEL][;u=UNCERTAINTY]'.  The
specified coordinates and uncertainty are converted into a DNS LOC record
for the service name label.  Only the &quot;wgs84&quot; CRSLABEL string is supported.<br>
<br>
You must call this function prior to <a href="#cupsDNSSDServiceAdd"><code>cupsDNSSDServiceAdd</code></a>.</p>
<h3 class="function"><a id="cupsDirClose">cupsDirClose</a></h3>
<p class="description">Close a directory.</p>
<p class="code">
<span class="reserved">void</span> cupsDirClose(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dp</th>
<td class="description">Directory pointer</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDirOpen">cupsDirOpen</a></h3>
<p class="description">Open a directory.</p>
<p class="code">
<a href="#cups_dir_t">cups_dir_t</a> *cupsDirOpen(<span class="reserved">const</span> <span class="reserved">char</span> *directory);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>directory</th>
<td class="description">Directory name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Directory pointer or <code>NULL</code> if the directory could not be opened.</p>
<h3 class="function"><a id="cupsDirRead">cupsDirRead</a></h3>
<p class="description">Read the next directory entry.</p>
<p class="code">
<a href="#cups_dentry_t">cups_dentry_t</a> *cupsDirRead(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dp</th>
<td class="description">Directory pointer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Directory entry or <code>NULL</code> when there are no more</p>
<h3 class="function"><a id="cupsDirRewind">cupsDirRewind</a></h3>
<p class="description">Rewind to the start of the directory.</p>
<p class="code">
<span class="reserved">void</span> cupsDirRewind(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dp</th>
<td class="description">Directory pointer</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
<p class="description">Authenticate a request.</p>
<p class="code">
<span class="reserved">bool</span> cupsDoAuthentication(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *method, <span class="reserved">const</span> <span class="reserved">char</span> *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>method</th>
<td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
<tr><th>resource</th>
<td class="description">Resource path</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure/error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function performs authentication for a request.  It should be called in
response to a <code>HTTP_STATUS_UNAUTHORIZED</code> status, prior to resubmitting your
request.</p>
<h3 class="function"><a id="cupsDoFileRequest">cupsDoFileRequest</a></h3>
<p class="description">Do an IPP request with a file.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *cupsDoFileRequest(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *request, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
<tr><th>resource</th>
<td class="description">HTTP resource for POST</td></tr>
<tr><th>filename</th>
<td class="description">File to send or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request and attached file to the specified
server, retrying and authenticating as necessary.  The request is freed with
<a href="#ippDelete"><code>ippDelete</code></a>.</p>
<h3 class="function"><a id="cupsDoIORequest">cupsDoIORequest</a></h3>
<p class="description">Do an IPP request with file descriptors.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *cupsDoIORequest(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *request, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">int</span> infile, <span class="reserved">int</span> outfile);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
<tr><th>resource</th>
<td class="description">HTTP resource for POST</td></tr>
<tr><th>infile</th>
<td class="description">File to read from or <code>-1</code> for none</td></tr>
<tr><th>outfile</th>
<td class="description">File to write to or <code>-1</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request with the optional input file &quot;infile&quot; to
the specified server, retrying and authenticating as necessary.  The request
is freed with <a href="#ippDelete"><code>ippDelete</code></a>.<br>
<br>
If &quot;infile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
all of the data from the file after the IPP request message.<br>
<br>
If &quot;outfile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
all of the data after the IPP response message to the file.</p>
<h3 class="function"><a id="cupsDoRequest">cupsDoRequest</a></h3>
<p class="description">Do an IPP request.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *cupsDoRequest(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *request, <span class="reserved">const</span> <span class="reserved">char</span> *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
<tr><th>resource</th>
<td class="description">HTTP resource for POST</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request to the specified server, retrying
and authenticating as necessary.  The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>.</p>
<h3 class="function"><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
<p class="description">Encode a single option into an IPP attribute.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request/response</td></tr>
<tr><th>group_tag</th>
<td class="description">Attribute group</td></tr>
<tr><th>name</th>
<td class="description">Option name</td></tr>
<tr><th>value</th>
<td class="description">Option string value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute or <code>NULL</code> on error</p>
<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
<p class="description">Encode printer options into IPP attributes for a group.</p>
<p class="code">
<span class="reserved">void</span> cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options, ipp_tag_t group_tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request/response</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
<tr><th>group_tag</th>
<td class="description">Group to encode</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function encodes options as IPP attributes for a single group. Call this
function multiple times for each group as needed.</p>
<h3 class="function"><a id="cupsEncodingString">cupsEncodingString</a></h3>
<p class="description">Return the character encoding name string for the
                         given encoding enumeration.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsEncodingString(cups_encoding_t value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>value</th>
<td class="description">Encoding value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Character encoding string</p>
<h3 class="function"><a id="cupsEncodingValue">cupsEncodingValue</a></h3>
<p class="description">Return the encoding enumeration value for a given
                        character encoding name string.</p>
<p class="code">
cups_encoding_t cupsEncodingValue(<span class="reserved">const</span> <span class="reserved">char</span> *s);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">Character encoding string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Encoding value</p>
<h3 class="function"><a id="cupsEnumDests">cupsEnumDests</a></h3>
<p class="description">Enumerate available destinations with a callback function.</p>
<p class="code">
<span class="reserved">bool</span> cupsEnumDests(<span class="reserved">unsigned</span> flags, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel, <a href="#cups_ptype_t">cups_ptype_t</a> type, <a href="#cups_ptype_t">cups_ptype_t</a> mask, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, <span class="reserved">void</span> *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>flags</th>
<td class="description">Enumeration flags</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
<tr><th>type</th>
<td class="description">Printer type bits</td></tr>
<tr><th>mask</th>
<td class="description">Mask for printer type bits</td></tr>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Destinations are enumerated from one or more sources.  The callback function
receives the &quot;user_data&quot; pointer and the destination pointer which can be
used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function.  The function must return
<code>true</code> to continue enumeration or <code>false</code> to stop.<br>
<br>
The &quot;type&quot; and &quot;mask&quot; arguments allow the caller to filter the destinations
that are enumerated.  Passing <code>0</code> for both will enumerate all printers.  The
constant <code>CUPS_PTYPE_DISCOVERED</code> is used to filter on destinations that are
available but have not yet been added locally.<br>
<br>
Enumeration happens on the current thread and does not return until all
destinations have been enumerated or the callback function returns <code>false</code>.<br>
<br>
Note: The callback function will likely receive multiple updates for the same
destinations - it is up to the caller to suppress any duplicate destinations.</p>
<h3 class="function"><a id="cupsFileClose">cupsFileClose</a></h3>
<p class="description">Close a CUPS file.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileClose(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFileEOF">cupsFileEOF</a></h3>
<p class="description">Return the end-of-file status.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileEOF(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on end of file, <code>false</code> otherwise</p>
<h3 class="function"><a id="cupsFileFind">cupsFileFind</a></h3>
<p class="description">Find a file using the specified path.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsFileFind(<span class="reserved">const</span> <span class="reserved">char</span> *filename, <span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">bool</span> executable, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>filename</th>
<td class="description">File to find</td></tr>
<tr><th>path</th>
<td class="description">Colon/semicolon-separated path</td></tr>
<tr><th>executable</th>
<td class="description"><code>true</code> = executable files, <code>false</code> = any file/dir</td></tr>
<tr><th>buffer</th>
<td class="description">Filename buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of filename buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Full path to file or <code>NULL</code> if not found</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function allows the paths in the path string to be separated by
colons (POSIX standard) or semicolons (Windows standard) and stores the
result in the buffer supplied.  If the file cannot be found in any of
the supplied paths, <code>NULL</code> is returned.  A <code>NULL</code> path only matches the
current directory.</p>
<h3 class="function"><a id="cupsFileFlush">cupsFileFlush</a></h3>
<p class="description">Flush pending output.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileFlush(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFileGetChar">cupsFileGetChar</a></h3>
<p class="description">Get a single character from a file.</p>
<p class="code">
<span class="reserved">int</span> cupsFileGetChar(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Character or <code>-1</code> on end of file</p>
<h3 class="function"><a id="cupsFileGetConf">cupsFileGetConf</a></h3>
<p class="description">Get a line from a configuration file.</p>
<p class="code">
<span class="reserved">char</span> *cupsFileGetConf(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">char</span> *buf, size_t buflen, <span class="reserved">char</span> **value, <span class="reserved">int</span> *linenum);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>buf</th>
<td class="description">String buffer</td></tr>
<tr><th>buflen</th>
<td class="description">Size of string buffer</td></tr>
<tr><th>value</th>
<td class="description">Pointer to value</td></tr>
<tr><th>linenum</th>
<td class="description">Current line number</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Line read or <code>NULL</code> on end of file or error</p>
<h3 class="function"><a id="cupsFileGetLine">cupsFileGetLine</a></h3>
<p class="description">Get a CR and/or LF-terminated line that may
                      contain binary data.</p>
<p class="code">
size_t cupsFileGetLine(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">char</span> *buf, size_t buflen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">File to read from</td></tr>
<tr><th>buf</th>
<td class="description">Buffer</td></tr>
<tr><th>buflen</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes on line or 0 on end of file</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function differs from <a href="#cupsFileGets"><code>cupsFileGets</code></a> in that the trailing CR
and LF are preserved, as is any binary data on the line. The buffer is
<code>nul</code>-terminated, however you should use the returned length to determine
the number of bytes on the line.</p>
<h3 class="function"><a id="cupsFileGets">cupsFileGets</a></h3>
<p class="description">Get a CR and/or LF-terminated line.</p>
<p class="code">
<span class="reserved">char</span> *cupsFileGets(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">char</span> *buf, size_t buflen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>buf</th>
<td class="description">String buffer</td></tr>
<tr><th>buflen</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Line read or <code>NULL</code> on end of file or error</p>
<h3 class="function"><a id="cupsFileIsCompressed">cupsFileIsCompressed</a></h3>
<p class="description">Return whether a file is compressed.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileIsCompressed(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if compressed, <code>false</code> if not</p>
<h3 class="function"><a id="cupsFileLock">cupsFileLock</a></h3>
<p class="description">Temporarily lock access to a file.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileLock(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">bool</span> block);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>block</th>
<td class="description"><code>true</code> to wait for the lock, <code>false</code> to fail right away</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFileNumber">cupsFileNumber</a></h3>
<p class="description">Return the file descriptor associated with a CUPS file.</p>
<p class="code">
<span class="reserved">int</span> cupsFileNumber(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">File descriptor</p>
<h3 class="function"><a id="cupsFileOpen">cupsFileOpen</a></h3>
<p class="description">Open a CUPS file.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsFileOpen(<span class="reserved">const</span> <span class="reserved">char</span> *filename, <span class="reserved">const</span> <span class="reserved">char</span> *mode);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>filename</th>
<td class="description">Name of file</td></tr>
<tr><th>mode</th>
<td class="description">Open mode</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file or <code>NULL</code> if the file or socket cannot be opened</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function opens a file or socket for use with the CUPS file API.<br>
<br>
The &quot;filename&quot; argument is a filename or socket address.<br>
<br>
The &quot;mode&quot; parameter can be &quot;r&quot; to read, &quot;w&quot; to write, overwriting any
existing file, &quot;a&quot; to append to an existing file or create a new file,
or &quot;s&quot; to open a socket connection.<br>
<br>
When opening for writing (&quot;w&quot;), an optional number from <code>1</code> to <code>9</code> can be
supplied which enables Flate compression of the file.  Compression is
not supported for the &quot;a&quot; (append) mode.<br>
<br>
When opening a socket connection, the filename is a string of the form
&quot;address:port&quot; or &quot;hostname:port&quot;. The socket will make an IPv4 or IPv6
connection as needed, generally preferring IPv6 connections when there is
a choice.</p>
<h3 class="function"><a id="cupsFileOpenFd">cupsFileOpenFd</a></h3>
<p class="description">Open a CUPS file using a file descriptor.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsFileOpenFd(<span class="reserved">int</span> fd, <span class="reserved">const</span> <span class="reserved">char</span> *mode);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">File descriptor</td></tr>
<tr><th>mode</th>
<td class="description">Open mode</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file or <code>NULL</code> if the file could not be opened</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function prepares a file descriptor for use with the CUPS file API.<br>
<br>
The &quot;fd&quot; argument specifies the file descriptor.<br>
<br>
The &quot;mode&quot; argument can be &quot;r&quot; to read, &quot;w&quot; to write, &quot;a&quot; to append,
or &quot;s&quot; to treat the file descriptor as a bidirectional socket connection.<br>
<br>
When opening for writing (&quot;w&quot;), an optional number from <code>1</code> to <code>9</code> can be
supplied which enables Flate compression of the file.  Compression is
not supported for the &quot;a&quot; (append) mode.</p>
<h3 class="function"><a id="cupsFilePeekChar">cupsFilePeekChar</a></h3>
<p class="description">Peek at the next character from a file.</p>
<p class="code">
<span class="reserved">int</span> cupsFilePeekChar(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Character or <code>-1</code> on end of file</p>
<h3 class="function"><a id="cupsFilePrintf">cupsFilePrintf</a></h3>
<p class="description">Write a formatted string.</p>
<p class="code">
<span class="reserved">bool</span> cupsFilePrintf(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional args as necessary</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFilePutChar">cupsFilePutChar</a></h3>
<p class="description">Write a character.</p>
<p class="code">
<span class="reserved">bool</span> cupsFilePutChar(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">int</span> c);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>c</th>
<td class="description">Character to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFilePutConf">cupsFilePutConf</a></h3>
<p class="description">Write a configuration line.</p>
<p class="code">
<span class="reserved">bool</span> cupsFilePutConf(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">const</span> <span class="reserved">char</span> *directive, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>directive</th>
<td class="description">Directive</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function handles any comment escaping of the value.</p>
<h3 class="function"><a id="cupsFilePuts">cupsFilePuts</a></h3>
<p class="description">Write a string.</p>
<p class="code">
<span class="reserved">bool</span> cupsFilePuts(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">const</span> <span class="reserved">char</span> *s);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>s</th>
<td class="description">String to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Like the <code>fputs</code> function, no newline is appended to the string.</p>
<h3 class="function"><a id="cupsFileRead">cupsFileRead</a></h3>
<p class="description">Read from a file.</p>
<p class="code">
ssize_t cupsFileRead(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">char</span> *buf, size_t bytes);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>buf</th>
<td class="description">Buffer</td></tr>
<tr><th>bytes</th>
<td class="description">Number of bytes to read</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes read or -1 on error</p>
<h3 class="function"><a id="cupsFileRewind">cupsFileRewind</a></h3>
<p class="description">Set the current file position to the beginning of the file.</p>
<p class="code">
off_t cupsFileRewind(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New file position or <code>-1</code> on error</p>
<h3 class="function"><a id="cupsFileSeek">cupsFileSeek</a></h3>
<p class="description">Seek in a file.</p>
<p class="code">
off_t cupsFileSeek(<a href="#cups_file_t">cups_file_t</a> *fp, off_t pos);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>pos</th>
<td class="description">Position in file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New file position or <code>-1</code> on error</p>
<h3 class="function"><a id="cupsFileStderr">cupsFileStderr</a></h3>
<p class="description">Return a CUPS file associated with stderr.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsFileStderr(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file</p>
<h3 class="function"><a id="cupsFileStdin">cupsFileStdin</a></h3>
<p class="description">Return a CUPS file associated with stdin.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsFileStdin(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file</p>
<h3 class="function"><a id="cupsFileStdout">cupsFileStdout</a></h3>
<p class="description">Return a CUPS file associated with stdout.</p>
<p class="code">
<a href="#cups_file_t">cups_file_t</a> *cupsFileStdout(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS file</p>
<h3 class="function"><a id="cupsFileTell">cupsFileTell</a></h3>
<p class="description">Return the current file position.</p>
<p class="code">
off_t cupsFileTell(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">File position</p>
<h3 class="function"><a id="cupsFileUnlock">cupsFileUnlock</a></h3>
<p class="description">Unlock access to a file.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileUnlock(<a href="#cups_file_t">cups_file_t</a> *fp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFileWrite">cupsFileWrite</a></h3>
<p class="description">Write to a file.</p>
<p class="code">
<span class="reserved">bool</span> cupsFileWrite(<a href="#cups_file_t">cups_file_t</a> *fp, <span class="reserved">const</span> <span class="reserved">char</span> *buf, size_t bytes);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">CUPS file</td></tr>
<tr><th>buf</th>
<td class="description">Buffer</td></tr>
<tr><th>bytes</th>
<td class="description">Number of bytes to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.</p>
<h3 class="function"><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.</p>
<h3 class="function"><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.</p>
<h3 class="function"><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
<p class="description">Finish the current document.</p>
<p class="code">
ipp_status_t cupsFinishDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document submission</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function finished the current document for a job on the specified
destination &quot;dest&quot;.  The &quot;info&quot; argument contains information about the
destination obtained using the <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a> function.<br>
<br>
Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.</p>
<h3 class="function"><a id="cupsFormDecode">cupsFormDecode</a></h3>
<p class="description">Decode URL-encoded form data.</p>
<p class="code">
size_t cupsFormDecode(<span class="reserved">const</span> <span class="reserved">char</span> *data, <a href="#cups_option_t">cups_option_t</a> **vars);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>data</th>
<td class="description">URL-encoded form data</td></tr>
<tr><th>vars</th>
<td class="description">Array of variables</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of variables</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function decodes URL-encoded form data, returning the number of
variables and a pointer to a <a href="#cups_option_t"><code>cups_option_t</code></a> array of the variables.<br>
<br>
Use the <a href="#cupsFreeOptions"><code>cupsFreeOptions</code></a> function to return the memory used when you
are done with the form variables.</p>
<h3 class="function"><a id="cupsFormEncode">cupsFormEncode</a></h3>
<p class="description">Encode options as URL-encoded form data.</p>
<p class="code">
<span class="reserved">char</span> *cupsFormEncode(<span class="reserved">const</span> <span class="reserved">char</span> *url, size_t num_vars, <a href="#cups_option_t">cups_option_t</a> *vars);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>url</th>
<td class="description">URL or <code>NULL</code> for none</td></tr>
<tr><th>num_vars</th>
<td class="description">Number of variables</td></tr>
<tr><th>vars</th>
<td class="description">Variables</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">URL-encoded form data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function encodes a CUPS options array as URL-encoded form data with an
optional URL prefix, returning an allocated string.<br>
<br>
Use <code>free</code> to return the memory used for the string.</p>
<h3 class="function"><a id="cupsFormatString">cupsFormatString</a></h3>
<p class="description">Format a UTF-8 string into a fixed size buffer.</p>
<p class="code">
ssize_t cupsFormatString(<span class="reserved">char</span> *buffer, size_t bufsize, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>buffer</th>
<td class="description">Output buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of output buffer</td></tr>
<tr><th>format</th>
<td class="description"><code>printf</code>-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes formatted</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function formats a UTF-8 string into a fixed size buffer, escaping
special/control characters as needed so they can be safely displayed or
logged.</p>
<h3 class="function"><a id="cupsFormatStringv">cupsFormatStringv</a></h3>
<p class="description">Format a UTF-8 string into a fixed size buffer (<code>va_list</code> version).</p>
<p class="code">
ssize_t cupsFormatStringv(<span class="reserved">char</span> *buffer, size_t bufsize, <span class="reserved">const</span> <span class="reserved">char</span> *format, va_list ap);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>buffer</th>
<td class="description">Output buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of output buffer</td></tr>
<tr><th>format</th>
<td class="description">printf-style format string</td></tr>
<tr><th>ap</th>
<td class="description">Pointer to additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes formatted</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function formats a UTF-8 string into a fixed size buffer using a
variable argument pointer, escaping special/control characters as needed so
they can be safely displayed or logged.</p>
<h3 class="function"><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
<p class="description">Free destination information obtained using
                       <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
<p class="code">
<span class="reserved">void</span> cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
<p class="description">Free the memory used by the list of destinations.</p>
<p class="code">
<span class="reserved">void</span> cupsFreeDests(size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
<p class="description">Free memory used by job data.</p>
<p class="code">
<span class="reserved">void</span> cupsFreeJobs(size_t num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_jobs</th>
<td class="description">Number of jobs</td></tr>
<tr><th>jobs</th>
<td class="description">Jobs</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
<p class="description">Free all memory used by options.</p>
<p class="code">
<span class="reserved">void</span> cupsFreeOptions(size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsGetCredentialsExpiration">cupsGetCredentialsExpiration</a></h3>
<p class="description">Return the expiration date of the credentials.</p>
<p class="code">
time_t cupsGetCredentialsExpiration(<span class="reserved">const</span> <span class="reserved">char</span> *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Expiration date of credentials</p>
<h3 class="function"><a id="cupsGetCredentialsInfo">cupsGetCredentialsInfo</a></h3>
<p class="description">Return a string describing the credentials.</p>
<p class="code">
<span class="reserved">char</span> *cupsGetCredentialsInfo(<span class="reserved">const</span> <span class="reserved">char</span> *credentials, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Credentials description or <code>NULL</code> on error</p>
<h3 class="function"><a id="cupsGetCredentialsTrust">cupsGetCredentialsTrust</a></h3>
<p class="description">Return the trust of credentials.</p>
<p class="code">
<a href="#http_trust_t">http_trust_t</a> cupsGetCredentialsTrust(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *credentials, <span class="reserved">bool</span> require_ca);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name for trust lookup</td></tr>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>require_ca</th>
<td class="description">Require a CA-signed certificate?</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Level of trust</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function determines the level of trust for the supplied credentials.
The &quot;path&quot; parameter specifies the certificate/key store for known
credentials and certificate authorities.  The &quot;common_name&quot; parameter
specifies the FQDN of the service being accessed such as
&quot;printer.example.com&quot;.  The &quot;credentials&quot; parameter provides the credentials
being evaluated, which are usually obtained with the
<a href="#httpCopyPeerCredentials"><code>httpCopyPeerCredentials</code></a> function.  The &quot;require_ca&quot; parameter
specifies whether a CA-signed certificate is required for trust.<br>
<br>
The <code>AllowAnyRoot</code>, <code>AllowExpiredCerts</code>, <code>TrustOnFirstUse</code>, and
<code>ValidateCerts</code> options in the &quot;client.conf&quot; file (or corresponding
preferences file on macOS) control the trust policy, which defaults to
AllowAnyRoot=Yes, AllowExpiredCerts=No, TrustOnFirstUse=Yes, and
ValidateCerts=No.  When the &quot;require_ca&quot; parameter is <code>true</code> the AllowAnyRoot
and TrustOnFirstUse policies are turned off (&quot;No&quot;).<br>
<br>
The returned trust value can be one of the following:

</p><ul>
<li><code>HTTP_TRUST_OK</code>: Credentials are OK/trusted
</li>
<li><code>HTTP_TRUST_INVALID</code>: Credentials are invalid
</li>
<li><code>HTTP_TRUST_EXPIRED</code>: Credentials are expired
</li>
<li><code>HTTP_TRUST_RENEWED</code>: Credentials have been renewed
</li>
<li><code>HTTP_TRUST_UNKNOWN</code>: Credentials are unknown/new</li>
</ul>
<h3 class="function"><a id="cupsGetDefault">cupsGetDefault</a></h3>
<p class="description">Get the default printer or class for the specified server.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetDefault(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default printer or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the default printer or class as defined by
the LPDEST or PRINTER environment variables. If these environment
variables are not set, the server default destination is returned.
Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a>
functions to get the user-defined default printer, as this function does
not support the lpoptions-defined default printer.</p>
<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
<p class="description">Get the named destination from the list.</p>
<p class="code">
<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *instance, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination pointer or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function gets the named destination from the list of destinations.  Use
the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests"><code>cupsGetDests</code></a> functions to get a list of
supported destinations for the current user.</p>
<h3 class="function"><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
<p class="description">Get a media name, dimension, and margins for a
                              specific size.</p>
<p class="code">
<span class="reserved">bool</span> cupsGetDestMediaByIndex(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, size_t n, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>n</th>
<td class="description">Media size number (0-based)</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>media</th>
<td class="description">Media</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;flags&quot; parameter determines which set of media are indexed.  For
example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth borderless
size supported by the printer.</p>
<h3 class="function"><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
<span class="reserved">bool</span> cupsGetDestMediaByName(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>name</th>
<td class="description">Media name</td></tr>
<tr><th>flags</th>
<td class="description">Media matching flags</td></tr>
<tr><th>media</th>
<td class="description">Media</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on match, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;media&quot; string is a PWG media name.  &quot;Flags&quot; provides some matching
guidance (multiple flags can be combined):

</p><ul>
<li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: find the closest size supported by the printer,
</li>
<li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: find a borderless size,
</li>
<li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: find a size compatible with 2-sided printing,
</li>
<li><code>CUPS_MEDIA_FLAGS_EXACT</code>: find an exact match for the size, and
</li>
<li><code>CUPS_MEDIA_FLAGS_READY</code>: if the printer supports media sensing, find the
  size amongst the &quot;ready&quot; media.</li>
</ul>
<p class="discussion">The matching result (if any) is returned in the <code>cups_size_t</code> structure.<br>
<br>
Returns <code>true</code> when there is a match and <code>false</code> if there is not a match.</p>
<h3 class="function"><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
<span class="reserved">bool</span> cupsGetDestMediaBySize(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">int</span> width, <span class="reserved">int</span> length, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>width</th>
<td class="description">Media width in hundredths of millimeters</td></tr>
<tr><th>length</th>
<td class="description">Media length in hundredths of millimeters</td></tr>
<tr><th>flags</th>
<td class="description">Media matching flags</td></tr>
<tr><th>media</th>
<td class="description">Media</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on match, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):

</p><ul>
<li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: find the closest size supported by the printer,
</li>
<li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: find a borderless size,
</li>
<li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: find a size compatible with 2-sided printing,
</li>
<li><code>CUPS_MEDIA_FLAGS_EXACT</code>: find an exact match for the size, and
</li>
<li><code>CUPS_MEDIA_FLAGS_READY</code>: if the printer supports media sensing, find the
  size amongst the &quot;ready&quot; media.</li>
</ul>
<p class="discussion">The matching result (if any) is returned in the <code>cups_size_t</code> structure.<br>
<br>
Returns <code>true</code> when there is a match and <code>false</code> if there is not a match.</p>
<h3 class="function"><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
<p class="description">Get the number of sizes supported by a
                            destination.</p>
<p class="code">
size_t cupsGetDestMediaCount(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">unsigned</span> flags);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of sizes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;flags&quot; parameter determines the set of media sizes that are counted.
For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the number of
borderless sizes.</p>
<h3 class="function"><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
<p class="description">Get the default size for a destination.</p>
<p class="code">
<span class="reserved">bool</span> cupsGetDestMediaDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>media</th>
<td class="description">Media</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on match, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;flags&quot; parameter determines which default size is returned.  For
example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
borderless size, typically US Letter or A4, but sometimes 4x6 photo media.</p>
<h3 class="function"><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
<p class="description">Get a destination associated with a URI.</p>
<p class="code">
<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Desired printer name or <code>NULL</code></td></tr>
<tr><th>uri</th>
<td class="description">URI for the printer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
created using the URI.<br>
<br>
&quot;uri&quot; is the 'ipp:' or 'ipps:' URI for the printer.</p>
<h3 class="function"><a id="cupsGetDests">cupsGetDests</a></h3>
<p class="description">Get the list of destinations from the specified server.</p>
<p class="code">
size_t cupsGetDests(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
&quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
&quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
&quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
attributes as options.<br>
<br>
CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
&quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
&quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
<br>
CUPS 2.2 adds accessible IPP printers to the list of destinations that can
be used.  The &quot;printer-uri-supported&quot; option will be present for those IPP
printers that have been recently used.<br>
<br>
Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.</p>
<h3 class="function"><a id="cupsGetEncryption">cupsGetEncryption</a></h3>
<p class="description">Get the current encryption settings.</p>
<p class="code">
<a href="#http_encryption_t">http_encryption_t</a> cupsGetEncryption(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Encryption settings</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting via the
<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
setting to be used.</p>
<h3 class="function"><a id="cupsGetError">cupsGetError</a></h3>
<p class="description">Return the last IPP status code received on the current
                    thread.</p>
<p class="code">
ipp_status_t cupsGetError(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code from last request</p>
<h3 class="function"><a id="cupsGetErrorString">cupsGetErrorString</a></h3>
<p class="description">Return the last IPP status-message received on the
                          current thread.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetErrorString(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">&quot;status-message&quot; text from last request</p>
<h3 class="function"><a id="cupsGetFd">cupsGetFd</a></h3>
<p class="description">Get a file from the server.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsGetFd(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">int</span> fd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>resource</th>
<td class="description">Resource name</td></tr>
<tr><th>fd</th>
<td class="description">File descriptor</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.</p>
<h3 class="function"><a id="cupsGetFile">cupsGetFile</a></h3>
<p class="description">Get a file from the server.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsGetFile(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>resource</th>
<td class="description">Resource name</td></tr>
<tr><th>filename</th>
<td class="description">Filename</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.</p>
<h3 class="function"><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
<p class="description">Get an integer option value.</p>
<p class="code">
<span class="reserved">long</span> cupsGetIntegerOption(<span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Option value or <code>LONG_MIN</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion"><code>LONG_MIN</code> is returned when the option does not exist, is not an integer, or
exceeds the range of values for the <code>long</code> type.</p>
<h3 class="function"><a id="cupsGetJobs">cupsGetJobs</a></h3>
<p class="description">Get the jobs from the specified server.</p>
<p class="code">
size_t cupsGetJobs(<a href="#http_t">http_t</a> *http, <a href="#cups_job_t">cups_job_t</a> **jobs, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">bool</span> myjobs, <a href="#cups_whichjobs_t">cups_whichjobs_t</a> whichjobs);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>jobs</th>
<td class="description">Job data</td></tr>
<tr><th>name</th>
<td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
<tr><th>myjobs</th>
<td class="description"><code>false</code> = all users, <code>true</code> = mine</td></tr>
<tr><th>whichjobs</th>
<td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of jobs</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function gets an array of jobs from the specified server.<br>
<br>
The &quot;name&quot; argument specifies a destination name.  The &quot;myjobs&quot; argument
specifies whether to only show jobs for the current user (<code>true</code>) or for
all users (<code>false</code>).<br>
<br>
The &quot;whichjobs&quot; argument specifies which jobs to return -
<code>CUPS_WHICHJOBS_ALL</code> to return all jobs regardless of state,
<code>CUPS_WHICHJOBS_ACTIVE</code> to return jobs that are pending, processing, or held,
and <code>CUPS_WHICHJOBS_COMPLETED</code> to return jobs that are stopped, canceled,
aborted, or completed.</p>
<h3 class="function"><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
<p class="description">Get options for the named destination.</p>
<p class="code">
<a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *instance);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>name</th>
<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is optimized for retrieving a single destination and should
be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
either know the name of the destination or want to print to the default
destination.  If <code>NULL</code> is returned, the destination does not exist or
there is no default destination.<br>
<br>
If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
server will be used.<br>
<br>
If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
returned.<br>
<br>
The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
&quot;num_dests&quot; value of 1.</p>
<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
<p class="description">Get an option value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetOption(<span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Option value or <code>NULL</code></p>
<h3 class="function"><a id="cupsGetPassword">cupsGetPassword</a></h3>
<p class="description">Get a password from the user using the current
                       password callback.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetPassword(<span class="reserved">const</span> <span class="reserved">char</span> *prompt, <a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *method, <span class="reserved">const</span> <span class="reserved">char</span> *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>prompt</th>
<td class="description">Prompt string</td></tr>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>method</th>
<td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
<tr><th>resource</th>
<td class="description">Resource path</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Password</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
user does not provide a password.<br>
<br>
Note: The current password callback function is tracked separately for each
thread in a program. Multi-threaded programs that override the setting via
the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> function need to do so in each thread for the
same function to be used.</p>
<h3 class="function"><a id="cupsGetRand">cupsGetRand</a></h3>
<p class="description">Return a 32-bit pseudo-random number.</p>
<p class="code">
<span class="reserved">unsigned</span> cupsGetRand(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Random number</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns a 32-bit pseudo-random number suitable for use as
one-time identifiers or nonces.  The random numbers are generated/seeded
using system entropy.</p>
<h3 class="function"><a id="cupsGetResponse">cupsGetResponse</a></h3>
<p class="description">Get a response to an IPP request.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *cupsGetResponse(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>resource</th>
<td class="description">HTTP resource for POST</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response or <code>NULL</code> on HTTP error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use this function to get the response for an IPP request sent using
<a href="#cupsSendRequest"><code>cupsSendRequest</code></a>. For requests that return additional data, use
<a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> after getting a successful response,
otherwise call <a href="#httpFlush"><code>httpFlush</code></a> to complete the response processing.</p>
<h3 class="function"><a id="cupsGetServer">cupsGetServer</a></h3>
<p class="description">Return the hostname/address of the current server.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetServer(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Server name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
set, the default is the local system - either &quot;localhost&quot; or a domain socket
path.<br>
<br>
The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
address, or a domain socket pathname.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server via the
<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
server to be used.</p>
<h3 class="function"><a id="cupsGetUser">cupsGetUser</a></h3>
<p class="description">Return the current user's name.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetUser(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name with the
<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
name to be used.</p>
<h3 class="function"><a id="cupsGetUserAgent">cupsGetUserAgent</a></h3>
<p class="description">Return the default HTTP User-Agent string.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsGetUserAgent(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User-Agent string</p>
<h3 class="function"><a id="cupsHMACData">cupsHMACData</a></h3>
<p class="description">Perform a HMAC function on the given data.</p>
<p class="code">
ssize_t cupsHMACData(<span class="reserved">const</span> <span class="reserved">char</span> *algorithm, <span class="reserved">const</span> <span class="reserved">unsigned</span> <span class="reserved">char</span> *key, size_t keylen, <span class="reserved">const</span> <span class="reserved">void</span> *data, size_t datalen, <span class="reserved">unsigned</span> <span class="reserved">char</span> *hmac, size_t hmacsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>algorithm</th>
<td class="description">Hash algorithm</td></tr>
<tr><th>key</th>
<td class="description">Key</td></tr>
<tr><th>keylen</th>
<td class="description">Length of key</td></tr>
<tr><th>data</th>
<td class="description">Data to hash</td></tr>
<tr><th>datalen</th>
<td class="description">Length of data to hash</td></tr>
<tr><th>hmac</th>
<td class="description">HMAC buffer</td></tr>
<tr><th>hmacsize</th>
<td class="description">Size of HMAC buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">The length of the HMAC or <code>-1</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function performs a HMAC function on the given data with the given key.
The &quot;algorithm&quot; argument can be any of the registered, non-deprecated IPP
hash algorithms for the &quot;job-password-encryption&quot; attribute, including
&quot;sha&quot; for SHA-1, &quot;sha2-256&quot; for SHA2-256, etc.<br>
<br>
The &quot;hmac&quot; argument points to a buffer of &quot;hmacsize&quot; bytes and should be at
least 64 bytes in length for all of the supported algorithms.<br>
<br>
The returned HMAC is binary data.</p>
<h3 class="function"><a id="cupsHashData">cupsHashData</a></h3>
<p class="description">Perform a hash function on the given data.</p>
<p class="code">
ssize_t cupsHashData(<span class="reserved">const</span> <span class="reserved">char</span> *algorithm, <span class="reserved">const</span> <span class="reserved">void</span> *data, size_t datalen, <span class="reserved">unsigned</span> <span class="reserved">char</span> *hash, size_t hashsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>algorithm</th>
<td class="description">Algorithm name</td></tr>
<tr><th>data</th>
<td class="description">Data to hash</td></tr>
<tr><th>datalen</th>
<td class="description">Length of data to hash</td></tr>
<tr><th>hash</th>
<td class="description">Hash buffer</td></tr>
<tr><th>hashsize</th>
<td class="description">Size of hash buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Size of hash or -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function performs a hash function on the given data. The &quot;algorithm&quot;
argument can be any of the registered, non-deprecated IPP hash algorithms for
the &quot;job-password-encryption&quot; attribute, including &quot;sha&quot; for SHA-1,
&quot;sha2-256&quot; for SHA2-256, etc.<br>
<br>
The &quot;hash&quot; argument points to a buffer of &quot;hashsize&quot; bytes and should be at
least 64 bytes in length for all of the supported algorithms.<br>
<br>
The returned hash is binary data.</p>
<h3 class="function"><a id="cupsHashString">cupsHashString</a></h3>
<p class="description">Format a hash value as a hexadecimal string.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsHashString(<span class="reserved">const</span> <span class="reserved">unsigned</span> <span class="reserved">char</span> *hash, size_t hashsize, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>hash</th>
<td class="description">Hash</td></tr>
<tr><th>hashsize</th>
<td class="description">Size of hash</td></tr>
<tr><th>buffer</th>
<td class="description">String buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Formatted string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The passed buffer must be at least 2 * hashsize + 1 characters in length.</p>
<h3 class="function"><a id="cupsJSONAdd">cupsJSONAdd</a></h3>
<p class="description">Add a node to a JSON node.</p>
<p class="code">
<span class="reserved">void</span> cupsJSONAdd(<a href="#cups_json_t">cups_json_t</a> *parent, <a href="#cups_json_t">cups_json_t</a> *after, <a href="#cups_json_t">cups_json_t</a> *node);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent JSON node</td></tr>
<tr><th>after</th>
<td class="description">Previous sibling node or <code>NULL</code> to append to the end</td></tr>
<tr><th>node</th>
<td class="description">JSON node to add</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds an existing JSON node as a child of other JSON node.
The &quot;parent&quot; argument specifies the node to add to.  The &quot;after&quot; argument
specifies a child of the parent node or <code>NULL</code> to append to the end of the
children.<br>
<br>
Note: The node being added must not already be the child of another parent.</p>
<h3 class="function"><a id="cupsJSONDelete">cupsJSONDelete</a></h3>
<p class="description">Delete a JSON node and all of its children.</p>
<p class="code">
<span class="reserved">void</span> cupsJSONDelete(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON node</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJSONExportFile">cupsJSONExportFile</a></h3>
<p class="description">Save a JSON node tree to a file.</p>
<p class="code">
<span class="reserved">bool</span> cupsJSONExportFile(<a href="#cups_json_t">cups_json_t</a> *json, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON root node</td></tr>
<tr><th>filename</th>
<td class="description">JSON filename</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="cupsJSONExportString">cupsJSONExportString</a></h3>
<p class="description">Save a JSON node tree to a string.</p>
<p class="code">
<span class="reserved">char</span> *cupsJSONExportString(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON root node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON string or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function saves a JSON node tree to an allocated string.  The resulting
string must be freed using the <code>free</code> function.</p>
<h3 class="function"><a id="cupsJSONFind">cupsJSONFind</a></h3>
<p class="description">Find the value(s) associated with a given key.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONFind(<a href="#cups_json_t">cups_json_t</a> *json, <span class="reserved">const</span> <span class="reserved">char</span> *key);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON object node</td></tr>
<tr><th>key</th>
<td class="description">Object key</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON value or <code>NULL</code></p>
<h3 class="function"><a id="cupsJSONGetChild">cupsJSONGetChild</a></h3>
<p class="description">Get the first child node of an array or object node.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONGetChild(<a href="#cups_json_t">cups_json_t</a> *json, size_t n);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON array or object node</td></tr>
<tr><th>n</th>
<td class="description">Child node number (starting at <code>0</code>)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">First child node or <code>NULL</code></p>
<h3 class="function"><a id="cupsJSONGetCount">cupsJSONGetCount</a></h3>
<p class="description">Get the number of child nodes.</p>
<p class="code">
size_t cupsJSONGetCount(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON array or object node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of child nodes</p>
<h3 class="function"><a id="cupsJSONGetKey">cupsJSONGetKey</a></h3>
<p class="description">Get the key string, if any.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsJSONGetKey(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON string node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">String value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the key string for a JSON key node or <code>NULL</code> if
the node is not a key.</p>
<h3 class="function"><a id="cupsJSONGetNumber">cupsJSONGetNumber</a></h3>
<p class="description">Get the number value, if any.</p>
<p class="code">
<span class="reserved">double</span> cupsJSONGetNumber(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON number node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the number value for a JSON number node or <code>0.0</code> if
the node is not a number.</p>
<h3 class="function"><a id="cupsJSONGetParent">cupsJSONGetParent</a></h3>
<p class="description">Get the parent node, if any.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONGetParent(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Parent node or <code>NULL</code> if none</p>
<h3 class="function"><a id="cupsJSONGetSibling">cupsJSONGetSibling</a></h3>
<p class="description">Get the next sibling node, if any.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONGetSibling(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Sibling node or <code>NULL</code> if none</p>
<h3 class="function"><a id="cupsJSONGetString">cupsJSONGetString</a></h3>
<p class="description">Get the string value, if any.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsJSONGetString(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON string node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">String value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the string value for a JSON string node or <code>NULL</code> if
the node is not a string.</p>
<h3 class="function"><a id="cupsJSONGetType">cupsJSONGetType</a></h3>
<p class="description">Get the type of a JSON node.</p>
<p class="code">
<a href="#cups_jtype_t">cups_jtype_t</a> cupsJSONGetType(<a href="#cups_json_t">cups_json_t</a> *json);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>json</th>
<td class="description">JSON node</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON node type</p>
<h3 class="function"><a id="cupsJSONImportFile">cupsJSONImportFile</a></h3>
<p class="description">Load a JSON object file.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONImportFile(<span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>filename</th>
<td class="description">JSON filename</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Root JSON object node</p>
<h3 class="function"><a id="cupsJSONImportString">cupsJSONImportString</a></h3>
<p class="description">Load a JSON object from a string.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONImportString(<span class="reserved">const</span> <span class="reserved">char</span> *s);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">JSON string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Root JSON object node</p>
<h3 class="function"><a id="cupsJSONImportURL">cupsJSONImportURL</a></h3>
<p class="description">Load a JSON object from a URL.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONImportURL(<span class="reserved">const</span> <span class="reserved">char</span> *url, time_t *last_modified);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>url</th>
<td class="description">URL</td></tr>
<tr><th>last_modified</th>
<td class="description">Last modified date/time or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Root JSON object node</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function loads a JSON object from a URL.  The &quot;url&quot; can be a &quot;http:&quot; or
&quot;https:&quot; URL.  The &quot;last_modified&quot; argument provides a pointer to a <code>time_t</code>
variable with the last modified date and time from a previous load.  If
<code>NULL</code> or the variable has a value of 0, the JSON is loaded unconditionally
from the URL.<br>
<br>
On success, a pointer to the root JSON object node is returned and the
&quot;last_modified&quot; variable, if not <code>NULL</code>, is updated to the Last-Modified
date and time returned by the server.  Otherwise, <code>NULL</code> is returned with
the <a href="#cupsGetError"><code>cupsGetError</code></a> value set to <code>IPP_STATUS_OK_EVENTS_COMPLETE</code> if
the JSON data has not been updated since the &quot;last_modified&quot; date and time
or a suitable <code>IPP_STATUS_ERROR_</code> value if an error occurred.</p>
<h3 class="function"><a id="cupsJSONNew">cupsJSONNew</a></h3>
<p class="description">Create a new JSON node.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONNew(<a href="#cups_json_t">cups_json_t</a> *parent, <a href="#cups_json_t">cups_json_t</a> *after, <a href="#cups_jtype_t">cups_jtype_t</a> type);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent JSON node or <code>NULL</code> for a root node</td></tr>
<tr><th>after</th>
<td class="description">Previous sibling node or <code>NULL</code> to append to the end</td></tr>
<tr><th>type</th>
<td class="description">JSON node type</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON node</p>
<h3 class="function"><a id="cupsJSONNewKey">cupsJSONNewKey</a></h3>
<p class="description">Create a new JSON key node.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONNewKey(<a href="#cups_json_t">cups_json_t</a> *parent, <a href="#cups_json_t">cups_json_t</a> *after, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent JSON node or <code>NULL</code> for a root node</td></tr>
<tr><th>after</th>
<td class="description">Previous sibling node or <code>NULL</code> to append to the end</td></tr>
<tr><th>value</th>
<td class="description">Key string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON node</p>
<h3 class="function"><a id="cupsJSONNewNumber">cupsJSONNewNumber</a></h3>
<p class="description">Create a new JSON number node.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONNewNumber(<a href="#cups_json_t">cups_json_t</a> *parent, <a href="#cups_json_t">cups_json_t</a> *after, <span class="reserved">double</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent JSON node or <code>NULL</code> for a root node</td></tr>
<tr><th>after</th>
<td class="description">Previous sibling node or <code>NULL</code> to append to the end</td></tr>
<tr><th>value</th>
<td class="description">Number value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON node</p>
<h3 class="function"><a id="cupsJSONNewString">cupsJSONNewString</a></h3>
<p class="description">Create a new JSON string node.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJSONNewString(<a href="#cups_json_t">cups_json_t</a> *parent, <a href="#cups_json_t">cups_json_t</a> *after, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent JSON node or <code>NULL</code> for a root node</td></tr>
<tr><th>after</th>
<td class="description">Previous sibling node or <code>NULL</code> to append to the end</td></tr>
<tr><th>value</th>
<td class="description">String value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON node</p>
<h3 class="function"><a id="cupsJWTDelete">cupsJWTDelete</a></h3>
<p class="description">Free the memory used for a JSON Web Token.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTDelete(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTExportString">cupsJWTExportString</a></h3>
<p class="description">Export a JWT with the JWS Compact or JWS JSON (Flattened) Serialization format.</p>
<p class="code">
<span class="reserved">char</span> *cupsJWTExportString(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <a href="#cups_jws_format_t">cups_jws_format_t</a> format);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>format</th>
<td class="description">JWS serialization format</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JWT/JWS Serialization string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function exports a JWT to a JWS Compact or JWS JSON Serialization
string.  The JSON output is always the &quot;flattened&quot; format since the JWT
only contains a single signature.<br>
<br>
The return value must be freed using the <code>free</code> function.</p>
<h3 class="function"><a id="cupsJWTGetAlgorithm">cupsJWTGetAlgorithm</a></h3>
<p class="description">Get the signature algorithm used by a JSON Web Token.</p>
<p class="code">
<a href="#cups_jwa_t">cups_jwa_t</a> cupsJWTGetAlgorithm(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Signature algorithm</p>
<h3 class="function"><a id="cupsJWTGetClaimNumber">cupsJWTGetClaimNumber</a></h3>
<p class="description">Get the number value of a claim.</p>
<p class="code">
<span class="reserved">double</span> cupsJWTGetClaimNumber(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number value</p>
<h3 class="function"><a id="cupsJWTGetClaimString">cupsJWTGetClaimString</a></h3>
<p class="description">Get the string value of a claim.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsJWTGetClaimString(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">String value</p>
<h3 class="function"><a id="cupsJWTGetClaimType">cupsJWTGetClaimType</a></h3>
<p class="description">Get the value type of a claim.</p>
<p class="code">
<a href="#cups_jtype_t">cups_jtype_t</a> cupsJWTGetClaimType(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON value type</p>
<h3 class="function"><a id="cupsJWTGetClaimValue">cupsJWTGetClaimValue</a></h3>
<p class="description">Get the value node of a claim.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTGetClaimValue(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON value node</p>
<h3 class="function"><a id="cupsJWTGetClaims">cupsJWTGetClaims</a></h3>
<p class="description">Get the JWT claims as a JSON object.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTGetClaims(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON object</p>
<h3 class="function"><a id="cupsJWTGetHeaderNumber">cupsJWTGetHeaderNumber</a></h3>
<p class="description">Get the number value of a protected header.</p>
<p class="code">
<span class="reserved">double</span> cupsJWTGetHeaderNumber(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number value</p>
<h3 class="function"><a id="cupsJWTGetHeaderString">cupsJWTGetHeaderString</a></h3>
<p class="description">Get the string value of a protected header.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsJWTGetHeaderString(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">String value</p>
<h3 class="function"><a id="cupsJWTGetHeaderType">cupsJWTGetHeaderType</a></h3>
<p class="description">Get the value type of a protected header.</p>
<p class="code">
<a href="#cups_jtype_t">cups_jtype_t</a> cupsJWTGetHeaderType(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON value type</p>
<h3 class="function"><a id="cupsJWTGetHeaderValue">cupsJWTGetHeaderValue</a></h3>
<p class="description">Get the value node of a protected header.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTGetHeaderValue(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON value node</p>
<h3 class="function"><a id="cupsJWTGetHeaders">cupsJWTGetHeaders</a></h3>
<p class="description">Get the JWT protected headers as a JSON object.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTGetHeaders(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON object</p>
<h3 class="function"><a id="cupsJWTHasValidSignature">cupsJWTHasValidSignature</a></h3>
<p class="description">Determine whether the JWT has a valid signature.</p>
<p class="code">
<span class="reserved">bool</span> cupsJWTHasValidSignature(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <a href="#cups_json_t">cups_json_t</a> *jwk);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>jwk</th>
<td class="description">JWK key set</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if value, <code>false</code> otherwise</p>
<h3 class="function"><a id="cupsJWTImportString">cupsJWTImportString</a></h3>
<p class="description">Import a JSON Web Token or JSON Web Signature.</p>
<p class="code">
<a href="#cups_jwt_t">cups_jwt_t</a> *cupsJWTImportString(<span class="reserved">const</span> <span class="reserved">char</span> *s, <a href="#cups_jws_format_t">cups_jws_format_t</a> format);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">JWS string</td></tr>
<tr><th>format</th>
<td class="description">JWS serialization format</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JWT object</p>
<h3 class="function"><a id="cupsJWTMakePrivateKey">cupsJWTMakePrivateKey</a></h3>
<p class="description">Make a JSON Web Key for encryption and signing.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTMakePrivateKey(<a href="#cups_jwa_t">cups_jwa_t</a> alg);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>alg</th>
<td class="description">Signing/encryption algorithm</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Private JSON Web Key or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a JSON Web Key (JWK) for the specified JWS/JWE algorithm
for use when signing or encrypting JSON Web Tokens.  The resulting JWK
<em>must not</em> be provided to clients - instead, call <a href="#cupsJWTMakePublicKey"><code>cupsJWTMakePublicKey</code></a>
to produce a public key subset suitable for verification and decryption.</p>
<h3 class="function"><a id="cupsJWTMakePublicKey">cupsJWTMakePublicKey</a></h3>
<p class="description">Make a JSON Web Key for decryption and verification.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsJWTMakePublicKey(<a href="#cups_json_t">cups_json_t</a> *jwk);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwk</th>
<td class="description">Private JSON Web Key</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Public JSON Web Key or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a public JSON Web Key (JWK) from the specified private
JWK suitable for use when decrypting or verifying a JWE/JWS message.</p>
<h3 class="function"><a id="cupsJWTNew">cupsJWTNew</a></h3>
<p class="description">Create a new, empty JSON Web Token.</p>
<p class="code">
<a href="#cups_jwt_t">cups_jwt_t</a> *cupsJWTNew(<span class="reserved">const</span> <span class="reserved">char</span> *type);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>type</th>
<td class="description">JWT type or <code>NULL</code> for default (&quot;JWT&quot;)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JWT object</p>
<h3 class="function"><a id="cupsJWTSetClaimNumber">cupsJWTSetClaimNumber</a></h3>
<p class="description">Set a claim number.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetClaimNumber(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim, <span class="reserved">double</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
<tr><th>value</th>
<td class="description">Number value</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSetClaimString">cupsJWTSetClaimString</a></h3>
<p class="description">Set a claim string.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetClaimString(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
<tr><th>value</th>
<td class="description">String value</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSetClaimValue">cupsJWTSetClaimValue</a></h3>
<p class="description">Set a claim value.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetClaimValue(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *claim, <a href="#cups_json_t">cups_json_t</a> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>claim</th>
<td class="description">Claim name</td></tr>
<tr><th>value</th>
<td class="description">JSON value node</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSetHeaderNumber">cupsJWTSetHeaderNumber</a></h3>
<p class="description">Set a protected header number.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetHeaderNumber(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header, <span class="reserved">double</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
<tr><th>value</th>
<td class="description">Number value</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSetHeaderString">cupsJWTSetHeaderString</a></h3>
<p class="description">Set a protected header string.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetHeaderString(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
<tr><th>value</th>
<td class="description">String value</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSetHeaderValue">cupsJWTSetHeaderValue</a></h3>
<p class="description">Set a protected header value.</p>
<p class="code">
<span class="reserved">void</span> cupsJWTSetHeaderValue(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <span class="reserved">const</span> <span class="reserved">char</span> *header, <a href="#cups_json_t">cups_json_t</a> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>header</th>
<td class="description">Header name</td></tr>
<tr><th>value</th>
<td class="description">JSON value node</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsJWTSign">cupsJWTSign</a></h3>
<p class="description">Sign a JSON Web Token, creating a JSON Web Signature.</p>
<p class="code">
<span class="reserved">bool</span> cupsJWTSign(<a href="#cups_jwt_t">cups_jwt_t</a> *jwt, <a href="#cups_jwa_t">cups_jwa_t</a> alg, <a href="#cups_json_t">cups_json_t</a> *jwk);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>jwt</th>
<td class="description">JWT object</td></tr>
<tr><th>alg</th>
<td class="description">Signing algorithm</td></tr>
<tr><th>jwk</th>
<td class="description">JWK key set</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="cupsLangAddStrings">cupsLangAddStrings</a></h3>
<p class="description">Add strings for the specified language.</p>
<p class="code">
<span class="reserved">bool</span> cupsLangAddStrings(<span class="reserved">const</span> <span class="reserved">char</span> *language, <span class="reserved">const</span> <span class="reserved">char</span> *strings);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>language</th>
<td class="description">Language name</td></tr>
<tr><th>strings</th>
<td class="description">Contents of &quot;.strings&quot; file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="cupsLangDefault">cupsLangDefault</a></h3>
<p class="description">Return the default language.</p>
<p class="code">
<a href="#cups_lang_t">cups_lang_t</a> *cupsLangDefault(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Language data</p>
<h3 class="function"><a id="cupsLangFind">cupsLangFind</a></h3>
<p class="description">Find a language localization.</p>
<p class="code">
<a href="#cups_lang_t">cups_lang_t</a> *cupsLangFind(<span class="reserved">const</span> <span class="reserved">char</span> *language);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>language</th>
<td class="description">Language or locale name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Language data</p>
<h3 class="function"><a id="cupsLangFormatString">cupsLangFormatString</a></h3>
<p class="description">Create a localized formatted string.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLangFormatString(<a href="#cups_lang_t">cups_lang_t</a> *lang, <span class="reserved">char</span> *buffer, size_t bufsize, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language data</td></tr>
<tr><th>buffer</th>
<td class="description">Output buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of output buffer</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Formatted string</p>
<h3 class="function"><a id="cupsLangGetEncoding">cupsLangGetEncoding</a></h3>
<p class="description">Get the default encoding for the current locale.</p>
<p class="code">
cups_encoding_t cupsLangGetEncoding(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Character encoding</p>
<h3 class="function"><a id="cupsLangGetName">cupsLangGetName</a></h3>
<p class="description">Get the language name.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLangGetName(<a href="#cups_lang_t">cups_lang_t</a> *lang);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Language name</p>
<h3 class="function"><a id="cupsLangGetString">cupsLangGetString</a></h3>
<p class="description">Get a localized message string.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLangGetString(<a href="#cups_lang_t">cups_lang_t</a> *lang, <span class="reserved">const</span> <span class="reserved">char</span> *message);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language</td></tr>
<tr><th>message</th>
<td class="description">Message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized message</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function gets a localized UTF-8 message string for the specified
language.  If the message is not localized, the original message pointer is
returned.</p>
<h3 class="function"><a id="cupsLangLoadStrings">cupsLangLoadStrings</a></h3>
<p class="description">Load a message catalog for a language.</p>
<p class="code">
<span class="reserved">bool</span> cupsLangLoadStrings(<a href="#cups_lang_t">cups_lang_t</a> *lang, <span class="reserved">const</span> <span class="reserved">char</span> *filename, <span class="reserved">const</span> <span class="reserved">char</span> *strings);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language data</td></tr>
<tr><th>filename</th>
<td class="description">Filename of <code>NULL</code> for none</td></tr>
<tr><th>strings</th>
<td class="description">Strings or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="cupsLangPrintf">cupsLangPrintf</a></h3>
<p class="description">Print a formatted message string to a file.</p>
<p class="code">
ssize_t cupsLangPrintf(FILE *fp, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">File to write to</td></tr>
<tr><th>format</th>
<td class="description">Message string to use</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written</p>
<h3 class="function"><a id="cupsLangPuts">cupsLangPuts</a></h3>
<p class="description">Print a static message string to a file.</p>
<p class="code">
ssize_t cupsLangPuts(FILE *fp, <span class="reserved">const</span> <span class="reserved">char</span> *message);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fp</th>
<td class="description">File to write to</td></tr>
<tr><th>message</th>
<td class="description">Message string to use</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written</p>
<h3 class="function"><a id="cupsLangSetDirectory">cupsLangSetDirectory</a></h3>
<p class="description">Set a directory containing localizations.</p>
<p class="code">
<span class="reserved">void</span> cupsLangSetDirectory(<span class="reserved">const</span> <span class="reserved">char</span> *d);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>d</th>
<td class="description">Directory name</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsLangSetLocale">cupsLangSetLocale</a></h3>
<p class="description">Set the current locale and transcode the command-line.</p>
<p class="code">
<span class="reserved">void</span> cupsLangSetLocale(<span class="reserved">char</span> *argv[]);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>argv[]</th>
<td class="description">Command-line arguments</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
<p class="description">Get the localized string for a destination media
                            size.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLocalizeDestMedia(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">unsigned</span> flags, <a href="#cups_media_t">cups_media_t</a> *media);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>media</th>
<td class="description">Media info</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.</p>
<h3 class="function"><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
<p class="description">Get the localized string for a destination
                             option.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLocalizeDestOption(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option to localize</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.</p>
<h3 class="function"><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
<p class="description">Get the localized string for a destination
                            option+value pair.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsLocalizeDestValue(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, <span class="reserved">const</span> <span class="reserved">char</span> *option, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option to localize</td></tr>
<tr><th>value</th>
<td class="description">Value to localize</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.</p>
<h3 class="function"><a id="cupsLocalizeNotifySubject">cupsLocalizeNotifySubject</a></h3>
<p class="description">Return the localized subject for the given notification message.</p>
<p class="code">
<span class="reserved">char</span> *cupsLocalizeNotifySubject(<a href="#cups_lang_t">cups_lang_t</a> *lang, <a href="#ipp_t">ipp_t</a> *event);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language data</td></tr>
<tr><th>event</th>
<td class="description">Event data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Subject string or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns a localized subject string for the given notification
message.  The returned string must be freed by the caller using <code>free</code>.</p>
<h3 class="function"><a id="cupsLocalizeNotifyText">cupsLocalizeNotifyText</a></h3>
<p class="description">Return the localized text for the given notification message.</p>
<p class="code">
<span class="reserved">char</span> *cupsLocalizeNotifyText(<a href="#cups_lang_t">cups_lang_t</a> *lang, <a href="#ipp_t">ipp_t</a> *event);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>lang</th>
<td class="description">Language data</td></tr>
<tr><th>event</th>
<td class="description">Event data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Message text or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns a localized text string for the given notification
message.  The returned string must be freed by the caller using <code>free</code>.</p>
<h3 class="function"><a id="cupsMutexDestroy">cupsMutexDestroy</a></h3>
<p class="description">Destroy a mutex.</p>
<p class="code">
<span class="reserved">void</span> cupsMutexDestroy(<a href="#cups_mutex_t">cups_mutex_t</a> *mutex);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>mutex</th>
<td class="description">Mutex</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsMutexInit">cupsMutexInit</a></h3>
<p class="description">Initialize a mutex.</p>
<p class="code">
<span class="reserved">void</span> cupsMutexInit(<a href="#cups_mutex_t">cups_mutex_t</a> *mutex);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>mutex</th>
<td class="description">Mutex</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsMutexLock">cupsMutexLock</a></h3>
<p class="description">Lock a mutex.</p>
<p class="code">
<span class="reserved">void</span> cupsMutexLock(<a href="#cups_mutex_t">cups_mutex_t</a> *mutex);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>mutex</th>
<td class="description">Mutex</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsMutexUnlock">cupsMutexUnlock</a></h3>
<p class="description">Unlock a mutex.</p>
<p class="code">
<span class="reserved">void</span> cupsMutexUnlock(<a href="#cups_mutex_t">cups_mutex_t</a> *mutex);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>mutex</th>
<td class="description">Mutex</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsOAuthClearTokens">cupsOAuthClearTokens</a></h3>
<p class="description">Clear any cached authorization or refresh tokens.</p>
<p class="code">
<span class="reserved">void</span> cupsOAuthClearTokens(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization server URI</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource server URI</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsOAuthCopyAccessToken">cupsOAuthCopyAccessToken</a></h3>
<p class="description">Get a cached access token.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthCopyAccessToken(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri, time_t *access_expires);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
<tr><th>access_expires</th>
<td class="description">Access expiration time or <code>NULL</code> for don't care</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Access token</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a copy of a cached access token and any
associated expiration time for the given authorization and resource
server combination.  The returned access token must be freed using
the <code>free</code> function.  <code>NULL</code> is returned if no token is cached.</p>
<h3 class="function"><a id="cupsOAuthCopyClientId">cupsOAuthCopyClientId</a></h3>
<p class="description">Get the cached <code>client_id</code> value.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthCopyClientId(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *redirect_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>redirect_uri</th>
<td class="description">Redirection URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>client_id</code> value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a copy of the cached <code>client_id</code> value for a given
Authorization Server and Redirection URI.  The returned value must be freed
using the <code>free</code> function.  <code>NULL</code> is returned if no <code>client_id</code> is cached.</p>
<h3 class="function"><a id="cupsOAuthCopyId">cupsOAuthCopyId</a></h3>
<p class="description">Get cached identification information.</p>
<p class="code">
<a href="#cups_jwt_t">cups_jwt_t</a> *cupsOAuthCopyId(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Identification information</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a copy of cached identification information for the
given authorization and resource server combination.  The returned JWT must
be freed using the <a href="#cupsJWTDelete"><code>cupsJWTDelete</code></a> function.  <code>NULL</code> is returned if no
identification information is cached.</p>
<h3 class="function"><a id="cupsOAuthCopyRefreshToken">cupsOAuthCopyRefreshToken</a></h3>
<p class="description">Get a cached refresh token.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthCopyRefreshToken(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Refresh token</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes a copy of a cached refresh token for the given
authorization and resource server combination.  The returned refresh
token must be freed using the <code>free</code> function.  <code>NULL</code> is returned
if no token is cached.</p>
<h3 class="function"><a id="cupsOAuthGetAuthorizationCode">cupsOAuthGetAuthorizationCode</a></h3>
<p class="description">Authorize access using a web browser.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthGetAuthorizationCode(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <a href="#cups_json_t">cups_json_t</a> *metadata, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri, <span class="reserved">const</span> <span class="reserved">char</span> *scopes);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>metadata</th>
<td class="description">Authorization Server metadata</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
<tr><th>scopes</th>
<td class="description">Space-delimited scopes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Authorization code or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function performs the OAuth authorization flow to obtain an
authorization code for use with the <a href="#cupsOAuthGetTokens"><code>cupsOAuthGetTokens</code></a> function.<br>
<br>
The &quot;auth_uri&quot; parameter specifies the URI for the OAuth Authorization
Server.  The &quot;metadata&quot; parameter specifies the Authorization Server metadata
as obtained using <a href="#cupsOAuthCopyMetadata"><code>cupsOAuthCopyMetadata</code></a> and/or
<a href="#cupsOAuthGetMetadata"><code>cupsOAuthGetMetadata</code></a>.<br>
<br>
The &quot;resource_uri&quot; parameter specifies the URI for a resource (printer, web
file, etc.) that you which to access.<br>
<br>
The &quot;scopes&quot; parameter specifies zero or more whitespace-delimited scope
names to request during authorization.  The list of supported scope names are
available from the Authorization Server metadata, for example:

<pre>
cups_json_t *metadata = cupsOAuthGetMetadata(auth_uri);
cups_json_t *scopes_supported = cupsJSONFind(metadata, &quot;scopes_supported&quot;);
</pre>
</p>
<h3 class="function"><a id="cupsOAuthGetClientId">cupsOAuthGetClientId</a></h3>
<p class="description">Register a client application and get its ID.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthGetClientId(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <a href="#cups_json_t">cups_json_t</a> *metadata, <span class="reserved">const</span> <span class="reserved">char</span> *redirect_uri, <span class="reserved">const</span> <span class="reserved">char</span> *logo_uri, <span class="reserved">const</span> <span class="reserved">char</span> *tos_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>metadata</th>
<td class="description">Authorization Server metadata</td></tr>
<tr><th>redirect_uri</th>
<td class="description">Redirection URL</td></tr>
<tr><th>logo_uri</th>
<td class="description">Logo URL or <code>NULL</code> for none</td></tr>
<tr><th>tos_uri</th>
<td class="description">Terms-of-service URL or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>client_id</code> string or <code>NULL</code> on error</p>
<h3 class="function"><a id="cupsOAuthGetMetadata">cupsOAuthGetMetadata</a></h3>
<p class="description">Get the metadata for an Authorization Server.</p>
<p class="code">
<a href="#cups_json_t">cups_json_t</a> *cupsOAuthGetMetadata(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">JSON metadata or <code>NULL</code> on error</p>
<h3 class="function"><a id="cupsOAuthGetTokens">cupsOAuthGetTokens</a></h3>
<p class="description">Obtain access, ID, and refresh tokens from an
                         authorization code or refresh token.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthGetTokens(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <a href="#cups_json_t">cups_json_t</a> *metadata, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri, <span class="reserved">const</span> <span class="reserved">char</span> *grant_code, <a href="#cups_ogrant_t">cups_ogrant_t</a> grant_type, <span class="reserved">const</span> <span class="reserved">char</span> *redirect_uri, time_t *access_expires);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>metadata</th>
<td class="description">Authorization Server metadata</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
<tr><th>grant_code</th>
<td class="description">Authorization code or refresh token</td></tr>
<tr><th>grant_type</th>
<td class="description">Grant code type</td></tr>
<tr><th>redirect_uri</th>
<td class="description">Redirect URI</td></tr>
<tr><th>access_expires</th>
<td class="description">Expiration time for access token</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Access token or <code>NULL</code> on error</p>
<h3 class="function"><a id="cupsOAuthMakeAuthorizationURL">cupsOAuthMakeAuthorizationURL</a></h3>
<p class="description">Make an authorization URL.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthMakeAuthorizationURL(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <a href="#cups_json_t">cups_json_t</a> *metadata, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri, <span class="reserved">const</span> <span class="reserved">char</span> *scopes, <span class="reserved">const</span> <span class="reserved">char</span> *client_id, <span class="reserved">const</span> <span class="reserved">char</span> *code_verifier, <span class="reserved">const</span> <span class="reserved">char</span> *nonce, <span class="reserved">const</span> <span class="reserved">char</span> *redirect_uri, <span class="reserved">const</span> <span class="reserved">char</span> *state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization URI</td></tr>
<tr><th>metadata</th>
<td class="description">Authorization server metadata</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource URI</td></tr>
<tr><th>scopes</th>
<td class="description">Space-delimited scope(s)</td></tr>
<tr><th>client_id</th>
<td class="description">Client ID</td></tr>
<tr><th>code_verifier</th>
<td class="description">Code verifier string</td></tr>
<tr><th>nonce</th>
<td class="description">Nonce</td></tr>
<tr><th>redirect_uri</th>
<td class="description">Redirection URI</td></tr>
<tr><th>state</th>
<td class="description">State</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Authorization URL</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function makes an authorization URL for the specified authorization
server and resource.<br>
<br>
The &quot;auth_uri&quot; parameter specifies the URI for the OAuth Authorization
Server.  The &quot;metadata&quot; parameter specifies the Authorization Server metadata
as obtained using <a href="#cupsOAuthCopyMetadata"><code>cupsOAuthCopyMetadata</code></a> and/or
<a href="#cupsOAuthGetMetadata"><code>cupsOAuthGetMetadata</code></a>.<br>
<br>
The &quot;resource_uri&quot; parameter specifies the URI for a resource (printer, web
file, etc.) that you which to access.<br>
<br>
The &quot;scopes&quot; parameter specifies zero or more whitespace-delimited scope
names to request during authorization.  The list of supported scope names are
available from the Authorization Server metadata, for example:

<pre>
cups_json_t *metadata = cupsOAuthGetMetadata(auth_uri);
cups_json_t *scopes_supported = cupsJSONFind(metadata, &quot;scopes_supported&quot;);
</pre>

The &quot;client_id&quot; parameter specifies the client identifier obtained using
<a href="#cupsOAuthCopyClientId"><code>cupsOAuthCopyClientId</code></a> and/or <a href="#cupsOAuthGetClientId"><code>cupsOAuthGetClientId</code></a>.<br>
<br>
The &quot;client_id&quot; parameter is the string returned by
<a href="#cupsOAuthCopyClientId"><code>cupsOAuthCopyClientId</code></a> or <a href="#cupsOAuthGetClientId"><code>cupsOAuthGetClientId</code></a>.<br>
<br>
The &quot;code_verifier&quot; parameter specifies a random Base64URL-encoded string
that is used by the Proof Key for Code Exchange [RFC7636] extension to help
secure the authorization flow.  The <a href="#cupsOAuthMakeBase64Random"><code>cupsOAuthMakeBase64Random</code></a> function
can be used to generate this string.<br>
<br>
The &quot;nonce&quot; parameter specifies a random Base64URL-encoded string that is
used by OpenID to validate the ID token. The <a href="#cupsOAuthMakeBase64Random"><code>cupsOAuthMakeBase64Random</code></a>
function can be used to generate this string.<br>
<br>
The &quot;redirect_uri&quot; parameter specifies the URI that will receive the
authorization grant code.<br>
<br>
The &quot;state&quot; parameter is a unique (random) identifier for the authorization
request.  It is provided to the redirection URI as a form parameter.</p>
<h3 class="function"><a id="cupsOAuthMakeBase64Random">cupsOAuthMakeBase64Random</a></h3>
<p class="description">Make a random data string.</p>
<p class="code">
<span class="reserved">char</span> *cupsOAuthMakeBase64Random(size_t len);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>len</th>
<td class="description">Number of bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Random string</p>
<h3 class="function"><a id="cupsOAuthSetClientId">cupsOAuthSetClientId</a></h3>
<p class="description">Save client_id and client_secret values.</p>
<p class="code">
<span class="reserved">void</span> cupsOAuthSetClientId(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *redirect_uri, <span class="reserved">const</span> <span class="reserved">char</span> *client_id, <span class="reserved">const</span> <span class="reserved">char</span> *client_secret);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization Server URI</td></tr>
<tr><th>redirect_uri</th>
<td class="description">Redirection URI</td></tr>
<tr><th>client_id</th>
<td class="description">client_id</td></tr>
<tr><th>client_secret</th>
<td class="description">client_secret value or <code>NULL</code> for none</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsOAuthSetTokens">cupsOAuthSetTokens</a></h3>
<p class="description">Save authorization and refresh tokens.</p>
<p class="code">
<span class="reserved">void</span> cupsOAuthSetTokens(<span class="reserved">const</span> <span class="reserved">char</span> *auth_uri, <span class="reserved">const</span> <span class="reserved">char</span> *resource_uri, <span class="reserved">const</span> <span class="reserved">char</span> *access_token, time_t access_expires, <span class="reserved">const</span> <span class="reserved">char</span> *id_token, <span class="reserved">const</span> <span class="reserved">char</span> *refresh_token);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>auth_uri</th>
<td class="description">Authorization server FQDN</td></tr>
<tr><th>resource_uri</th>
<td class="description">Resource server FQDN</td></tr>
<tr><th>access_token</th>
<td class="description">Access token</td></tr>
<tr><th>access_expires</th>
<td class="description">Access expiration time</td></tr>
<tr><th>id_token</th>
<td class="description">ID token</td></tr>
<tr><th>refresh_token</th>
<td class="description">Refresh token</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
<p class="description">Parse options from a command-line argument.</p>
<p class="code">
size_t cupsParseOptions(<span class="reserved">const</span> <span class="reserved">char</span> *arg, size_t num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>arg</th>
<td class="description">Argument to parse</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options found</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options found</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts space-delimited name/value pairs according
to the PAPI text option ABNF specification. Collection values
(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
intact - use <code>cupsParseOptions</code> on the value to extract the
collection attributes.</p>
<h3 class="function"><a id="cupsPutFd">cupsPutFd</a></h3>
<p class="description">Put a file on the server.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsPutFd(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">int</span> fd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>resource</th>
<td class="description">Resource name</td></tr>
<tr><th>fd</th>
<td class="description">File descriptor</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>HTTP_STATUS_CREATED</code> when the file is stored
successfully.</p>
<h3 class="function"><a id="cupsPutFile">cupsPutFile</a></h3>
<p class="description">Put a file on the server.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsPutFile(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *resource, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>resource</th>
<td class="description">Resource name</td></tr>
<tr><th>filename</th>
<td class="description">Filename</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
successfully.</p>
<h3 class="function"><a id="cupsRWDestroy">cupsRWDestroy</a></h3>
<p class="description">Destroy a reader/writer lock.</p>
<p class="code">
<span class="reserved">void</span> cupsRWDestroy(<a href="#cups_rwlock_t">cups_rwlock_t</a> *rwlock);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>rwlock</th>
<td class="description">Reader/writer lock</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsRWInit">cupsRWInit</a></h3>
<p class="description">Initialize a reader/writer lock.</p>
<p class="code">
<span class="reserved">void</span> cupsRWInit(<a href="#cups_rwlock_t">cups_rwlock_t</a> *rwlock);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>rwlock</th>
<td class="description">Reader/writer lock</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsRWLockRead">cupsRWLockRead</a></h3>
<p class="description">Acquire a reader/writer lock for reading.</p>
<p class="code">
<span class="reserved">void</span> cupsRWLockRead(<a href="#cups_rwlock_t">cups_rwlock_t</a> *rwlock);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>rwlock</th>
<td class="description">Reader/writer lock</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsRWLockWrite">cupsRWLockWrite</a></h3>
<p class="description">Acquire a reader/writer lock for writing.</p>
<p class="code">
<span class="reserved">void</span> cupsRWLockWrite(<a href="#cups_rwlock_t">cups_rwlock_t</a> *rwlock);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>rwlock</th>
<td class="description">Reader/writer lock</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsRWUnlock">cupsRWUnlock</a></h3>
<p class="description">Release a reader/writer lock.</p>
<p class="code">
<span class="reserved">void</span> cupsRWUnlock(<a href="#cups_rwlock_t">cups_rwlock_t</a> *rwlock);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>rwlock</th>
<td class="description">Reader/writer lock</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsRasterClose">cupsRasterClose</a></h3>
<p class="description">Close a raster stream.</p>
<p class="code">
<span class="reserved">void</span> cupsRasterClose(<a href="#cups_raster_t">cups_raster_t</a> *r);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>r</th>
<td class="description">Stream to free</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The file descriptor associated with the raster stream must be closed
separately as needed.</p>
<h3 class="function"><a id="cupsRasterGetErrorString">cupsRasterGetErrorString</a></h3>
<p class="description">Return the last error from a raster function.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *cupsRasterGetErrorString(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Last error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">If there are no recent errors, <code>NULL</code> is returned.</p>
<h3 class="function"><a id="cupsRasterInitHeader">cupsRasterInitHeader</a></h3>
<p class="description">Initialize a page header for PWG Raster output.</p>
<p class="code">
<span class="reserved">bool</span> cupsRasterInitHeader(<a href="#cups_page_header_t">cups_page_header_t</a> *h, <a href="#cups_media_t">cups_media_t</a> *media, <span class="reserved">const</span> <span class="reserved">char</span> *optimize, <a href="#ipp_quality_t">ipp_quality_t</a> quality, <span class="reserved">const</span> <span class="reserved">char</span> *intent, <a href="#ipp_orient_t">ipp_orient_t</a> orientation, <span class="reserved">const</span> <span class="reserved">char</span> *sides, <span class="reserved">const</span> <span class="reserved">char</span> *type, <span class="reserved">int</span> xdpi, <span class="reserved">int</span> ydpi, <span class="reserved">const</span> <span class="reserved">char</span> *sheet_back);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>h</th>
<td class="description">Page header</td></tr>
<tr><th>media</th>
<td class="description">Media information</td></tr>
<tr><th>optimize</th>
<td class="description">IPP &quot;print-content-optimize&quot; value</td></tr>
<tr><th>quality</th>
<td class="description">IPP &quot;print-quality&quot; value</td></tr>
<tr><th>intent</th>
<td class="description">IPP &quot;print-rendering-intent&quot; value</td></tr>
<tr><th>orientation</th>
<td class="description">IPP &quot;orientation-requested&quot; value</td></tr>
<tr><th>sides</th>
<td class="description">IPP &quot;sides&quot; value</td></tr>
<tr><th>type</th>
<td class="description">PWG raster type string</td></tr>
<tr><th>xdpi</th>
<td class="description">Cross-feed direction (horizontal) resolution</td></tr>
<tr><th>ydpi</th>
<td class="description">Feed direction (vertical) resolution</td></tr>
<tr><th>sheet_back</th>
<td class="description">Transform for back side or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;media&quot; argument specifies the media to use.  The &quot;optimize&quot;, &quot;quality&quot;,
&quot;intent&quot;, &quot;orientation&quot;, and &quot;sides&quot; arguments specify additional IPP Job
Template attribute values that are reflected in the raster header.<br>
<br>
The &quot;type&quot; argument specifies a &quot;pwg-raster-document-type-supported&quot; value
that controls the color space and bit depth of the raster data.  Supported
values include:

</p><ul>
<li>&quot;adobe-rgb_8&quot;: 8-bit per component (24-bit) AdobeRGB
</li>
<li>&quot;adobe-rgb_16&quot;: 16-bit per component (48-bit) AdobeRGB
</li>
<li>&quot;black_1&quot;: 1-bit black (K)
</li>
<li>&quot;black_8&quot;: 8-bit black (K)
</li>
<li>&quot;black_16&quot;: 16-bit black (K)
</li>
<li>&quot;cmyk_8&quot;: 8-bit per component (32-bit) CMYK
</li>
<li>&quot;cmyk_16&quot;: 16-bit per component (64-bit) CMYK
</li>
<li>&quot;device1_8&quot; to &quot;device15_8&quot;: 8-bit per component DeviceN
</li>
<li>&quot;device1_16&quot; to &quot;device15_16&quot;: 16-bit per component DeviceN
</li>
<li>&quot;rgb_8&quot;: 8-bit per component (24-bit) DeviceRGB
</li>
<li>&quot;rgb_16&quot;: 16-bit per component (32-bit) DeviceRGB
</li>
<li>&quot;sgray_1&quot;: 1-bit sGray
</li>
<li>&quot;sgray_8&quot;: 8-bit sGray
</li>
<li>&quot;sgray_16&quot;: 16-bit sGray
</li>
<li>&quot;srgb_8&quot;: 8-bit per component (24-bit) sRGB
</li>
<li>&quot;srgb_16&quot;: 16-bit per component (48-bit) sRGB</li>
</ul>
<p class="discussion">The &quot;xres&quot; and &quot;yres&quot; arguments specify the raster resolution in dots per
inch.<br>
<br>
The &quot;sheet_back&quot; argument specifies a &quot;pwg-raster-document-sheet-back&quot; value
to apply for the back side of a page.  Pass <code>NULL</code> for the front side.</p>
<h3 class="function"><a id="cupsRasterOpen">cupsRasterOpen</a></h3>
<p class="description">Open a raster stream using a file descriptor.</p>
<p class="code">
<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpen(<span class="reserved">int</span> fd, <a href="#cups_raster_mode_t">cups_raster_mode_t</a> mode);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">File descriptor</td></tr>
<tr><th>mode</th>
<td class="description">Mode - <code>CUPS_RASTER_READ</code>, <code>CUPS_RASTER_WRITE</code>, <code>CUPS_RASTER_WRITE_COMPRESSED</code>, <code>CUPS_RASTER_WRITE_PWG</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New stream</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function associates a raster stream with the given file descriptor.
For most printer driver filters, &quot;fd&quot; will be 0 (stdin).  For most raster
image processor (RIP) filters that generate raster data, &quot;fd&quot; will be 1
(stdout).<br>
<br>
When writing raster data, the <code>CUPS_RASTER_WRITE</code>,
<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can
be used - compressed and PWG output is generally 25-50% smaller but adds a
100-300% execution time overhead.</p>
<h3 class="function"><a id="cupsRasterOpenIO">cupsRasterOpenIO</a></h3>
<p class="description">Open a raster stream using a callback function.</p>
<p class="code">
<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpenIO(<a href="#cups_raster_cb_t">cups_raster_cb_t</a> iocb, <span class="reserved">void</span> *ctx, <a href="#cups_raster_mode_t">cups_raster_mode_t</a> mode);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>iocb</th>
<td class="description">Read/write callback</td></tr>
<tr><th>ctx</th>
<td class="description">Context pointer for callback</td></tr>
<tr><th>mode</th>
<td class="description">Mode - <code>CUPS_RASTER_READ</code>, <code>CUPS_RASTER_WRITE</code>, <code>CUPS_RASTER_WRITE_COMPRESSED</code>, <code>CUPS_RASTER_WRITE_PWG</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New stream</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function associates a raster stream with the given callback function and
context pointer.<br>
<br>
When writing raster data, the <code>CUPS_RASTER_WRITE</code>,
<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can
be used - compressed and PWG output is generally 25-50% smaller but adds a
100-300% execution time overhead.</p>
<h3 class="function"><a id="cupsRasterReadHeader">cupsRasterReadHeader</a></h3>
<p class="description">Read a raster page header.</p>
<p class="code">
<span class="reserved">bool</span> cupsRasterReadHeader(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header_t">cups_page_header_t</a> *h);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>r</th>
<td class="description">Raster stream</td></tr>
<tr><th>h</th>
<td class="description">Pointer to header data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="cupsRasterReadPixels">cupsRasterReadPixels</a></h3>
<p class="description">Read raster pixels.</p>
<p class="code">
<span class="reserved">unsigned</span> cupsRasterReadPixels(<a href="#cups_raster_t">cups_raster_t</a> *r, <span class="reserved">unsigned</span> <span class="reserved">char</span> *p, <span class="reserved">unsigned</span> len);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>r</th>
<td class="description">Raster stream</td></tr>
<tr><th>p</th>
<td class="description">Pointer to pixel buffer</td></tr>
<tr><th>len</th>
<td class="description">Number of bytes to read</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes read</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">For best performance, filters should read one or more whole lines.
The &quot;cupsBytesPerLine&quot; value from the page header can be used to allocate
the line buffer and as the number of bytes to read.</p>
<h3 class="function"><a id="cupsRasterWriteHeader">cupsRasterWriteHeader</a></h3>
<p class="description">Write a raster page header.</p>
<p class="code">
<span class="reserved">bool</span> cupsRasterWriteHeader(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header_t">cups_page_header_t</a> *h);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>r</th>
<td class="description">Raster stream</td></tr>
<tr><th>h</th>
<td class="description">Pointer to header data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="cupsRasterWritePixels">cupsRasterWritePixels</a></h3>
<p class="description">Write raster pixels.</p>
<p class="code">
<span class="reserved">unsigned</span> cupsRasterWritePixels(<a href="#cups_raster_t">cups_raster_t</a> *r, <span class="reserved">unsigned</span> <span class="reserved">char</span> *p, <span class="reserved">unsigned</span> len);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>r</th>
<td class="description">Raster stream</td></tr>
<tr><th>p</th>
<td class="description">Bytes to write</td></tr>
<tr><th>len</th>
<td class="description">Number of bytes to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">For best performance, filters should write one or more whole lines.
The &quot;cupsBytesPerLine&quot; value from the page header can be used to allocate
the line buffer and as the number of bytes to write.</p>
<h3 class="function"><a id="cupsReadResponseData">cupsReadResponseData</a></h3>
<p class="description">Read additional data after the IPP response.</p>
<p class="code">
ssize_t cupsReadResponseData(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>buffer</th>
<td class="description">Buffer to use</td></tr>
<tr><th>length</th>
<td class="description">Number of bytes to read</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Bytes read, 0 on EOF, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is used after <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to read any trailing
document data after an IPP response.</p>
<h3 class="function"><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
<p class="description">Remove a destination from the destination list.</p>
<p class="code">
size_t cupsRemoveDest(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *instance, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Removing a destination/instance does not delete the class or printer
queue, merely the lpoptions for that destination/instance.  Use the
<a href="#cupsSetDests"><code>cupsSetDests</code></a> function to save the new options for the user.</p>
<h3 class="function"><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
<p class="description">Remove an option from an option array.</p>
<p class="code">
size_t cupsRemoveOption(<span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Option name</td></tr>
<tr><th>num_options</th>
<td class="description">Current number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of options</p>
<h3 class="function"><a id="cupsSaveCredentials">cupsSaveCredentials</a></h3>
<p class="description">Save the credentials associated with a printer/server.</p>
<p class="code">
<span class="reserved">bool</span> cupsSaveCredentials(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *credentials, <span class="reserved">const</span> <span class="reserved">char</span> *key);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name for certificate</td></tr>
<tr><th>credentials</th>
<td class="description">PEM-encoded certificate chain or <code>NULL</code> to remove</td></tr>
<tr><th>key</th>
<td class="description">PEM-encoded private key or <code>NULL</code> for none</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function saves the the PEM-encoded X.509 certificate chain string and
private key (if not <code>NULL</code>) to the directory &quot;path&quot; or, if &quot;path&quot; is <code>NULL</code>,
in a per-user or system-wide (when running as root) certificate/key store.</p>
<h3 class="function"><a id="cupsSendRequest">cupsSendRequest</a></h3>
<p class="description">Send an IPP request.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsSendRequest(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *request, <span class="reserved">const</span> <span class="reserved">char</span> *resource, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
<tr><th>resource</th>
<td class="description">Resource path</td></tr>
<tr><th>length</th>
<td class="description">Length of data to follow or <code>CUPS_LENGTH_VARIABLE</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Initial HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write any additional data (document, etc.)
for the request, <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to get the IPP response, and
<a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> to read any additional data following the
response. Only one request can be sent/queued at a time per <code>http_t</code>
connection.<br>
<br>
Returns the initial HTTP status code, which will be <code>HTTP_STATUS_CONTINUE</code>
on a successful send of the request.<br>
<br>
Note: Unlike <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a>, <a href="#cupsDoIORequest"><code>cupsDoIORequest</code></a>, and
<a href="#cupsDoRequest"><code>cupsDoRequest</code></a>, the request is NOT freed with <a href="#ippDelete"><code>ippDelete</code></a>.</p>
<h3 class="function"><a id="cupsSetClientCredentials">cupsSetClientCredentials</a></h3>
<p class="description">Set the default credentials to be used for TLS connections.</p>
<p class="code">
<span class="reserved">bool</span> cupsSetClientCredentials(<span class="reserved">const</span> <span class="reserved">char</span> *credentials, <span class="reserved">const</span> <span class="reserved">char</span> *key);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">PEM-encoded X.509 credentials string</td></tr>
<tr><th>key</th>
<td class="description">PEM-encoded private key</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The default credentials are tracked separately for each thread in a
program. Multi-threaded programs that override the setting need to do so in
each thread for the same setting to be used.</p>
<h3 class="function"><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
<p class="description">Set the default destination.</p>
<p class="code">
<span class="reserved">void</span> cupsSetDefaultDest(<span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *instance, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsSetDests">cupsSetDests</a></h3>
<p class="description">Save the list of destinations for the specified server.</p>
<p class="code">
<span class="reserved">bool</span> cupsSetDests(<a href="#http_t">http_t</a> *http, size_t num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
as root and ~/.../lpoptions when run as a normal user.</p>
<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
<p class="description">Set the encryption preference.</p>
<p class="code">
<span class="reserved">void</span> cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>e</th>
<td class="description">New encryption preference</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting need to do
so in each thread for the same setting to be used.</p>
<h3 class="function"><a id="cupsSetOAuthCB">cupsSetOAuthCB</a></h3>
<p class="description">Set the OAuth 2.0 callback for CUPS.</p>
<p class="code">
<span class="reserved">void</span> cupsSetOAuthCB(<a href="#cups_oauth_cb_t">cups_oauth_cb_t</a> cb, <span class="reserved">void</span> *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the OAuth 2.0 callback for the various CUPS APIs that
send HTTP requests. Pass <code>NULL</code> to restore the default (console-based)
callback.<br>
<br>
The OAuth callback receives the HTTP connection, realm name, scope name (if
any), resource path, and the &quot;user_data&quot; pointer for each request that
requires an OAuth access token. The function then returns either the Bearer
token string or <code>NULL</code> if no authorization could be obtained.<br>
<br>
Beyond reusing the Bearer token for subsequent requests on the same HTTP
connection, no caching of the token is done by the CUPS library.  The
callback can determine whether to refresh a cached token by examining any
existing token returned by the <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> function.<br>
<br>
Note: The current OAuth callback is tracked separately for each thread in a
program. Multi-threaded programs that override the callback need to do so in
each thread for the same callback to be used.</p>
<h3 class="function"><a id="cupsSetPasswordCB">cupsSetPasswordCB</a></h3>
<p class="description">Set the password callback for CUPS.</p>
<p class="code">
<span class="reserved">void</span> cupsSetPasswordCB(<a href="#cups_password_cb_t">cups_password_cb_t</a> cb, <span class="reserved">void</span> *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
reads the password from the console.<br>
<br>
Note: The current password callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.</p>
<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
<p class="description">Set the default server name and port.</p>
<p class="code">
<span class="reserved">void</span> cupsSetServer(<span class="reserved">const</span> <span class="reserved">char</span> *server);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>server</th>
<td class="description">Server name</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
addresses can be optionally followed by a colon and port number to override
the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
default server name and port.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server need to do so in each
thread for the same server to be used.</p>
<h3 class="function"><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
<p class="description">Set the default server credentials.</p>
<p class="code">
<span class="reserved">bool</span> cupsSetServerCredentials(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">bool</span> auto_create);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Default common name for server</td></tr>
<tr><th>auto_create</th>
<td class="description"><code>true</code> = automatically create self-signed certificates</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The server credentials are used by all threads in the running process.
This function is threadsafe.</p>
<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
<p class="description">Set the default user name.</p>
<p class="code">
<span class="reserved">void</span> cupsSetUser(<span class="reserved">const</span> <span class="reserved">char</span> *user);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>user</th>
<td class="description">User name</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
<br>
Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name need to do so
in each thread for the same user name to be used.</p>
<h3 class="function"><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
<p class="description">Set the default HTTP User-Agent string.</p>
<p class="code">
<span class="reserved">void</span> cupsSetUserAgent(<span class="reserved">const</span> <span class="reserved">char</span> *user_agent);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>user_agent</th>
<td class="description">User-Agent string or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Setting the string to NULL forces the default value containing the CUPS
version, IPP version, and operating system version and architecture.</p>
<h3 class="function"><a id="cupsSignCredentialsRequest">cupsSignCredentialsRequest</a></h3>
<p class="description">Sign an X.509 certificate signing request to produce an X.509 certificate chain.</p>
<p class="code">
<span class="reserved">bool</span> cupsSignCredentialsRequest(<span class="reserved">const</span> <span class="reserved">char</span> *path, <span class="reserved">const</span> <span class="reserved">char</span> *common_name, <span class="reserved">const</span> <span class="reserved">char</span> *request, <span class="reserved">const</span> <span class="reserved">char</span> *root_name, <a href="#cups_credpurpose_t">cups_credpurpose_t</a> allowed_purpose, <a href="#cups_credusage_t">cups_credusage_t</a> allowed_usage, <a href="#cups_cert_san_cb_t">cups_cert_san_cb_t</a> cb, <span class="reserved">void</span> *cb_data, time_t expiration_date);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Directory path for certificate/key store or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name to use</td></tr>
<tr><th>request</th>
<td class="description">PEM-encoded CSR</td></tr>
<tr><th>root_name</th>
<td class="description">Root certificate</td></tr>
<tr><th>allowed_purpose</th>
<td class="description">Allowed credential purpose(s)</td></tr>
<tr><th>allowed_usage</th>
<td class="description">Allowed credential usage(s)</td></tr>
<tr><th>cb</th>
<td class="description">subjectAltName callback or <code>NULL</code> to allow just .local</td></tr>
<tr><th>cb_data</th>
<td class="description">Callback data</td></tr>
<tr><th>expiration_date</th>
<td class="description">Certificate expiration date</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates an X.509 certificate from a signing request.  The
certificate is stored in the directory &quot;path&quot; or, if &quot;path&quot; is <code>NULL</code>, in a
per-user or system-wide (when running as root) certificate/key store.  The
generated certificate is signed by the named root certificate or, if
&quot;root_name&quot; is <code>NULL</code>, a site-wide default root certificate.  When
&quot;root_name&quot; is <code>NULL</code> and there is no site-wide default root certificate, a
self-signed certificate is generated instead.<br>
<br>
The &quot;allowed_purpose&quot; argument specifies the allowed purpose(s) used for the
credentials as a bitwise OR of the following constants:

</p><ul>
<li><code>CUPS_CREDPURPOSE_SERVER_AUTH</code> for validating TLS servers,
</li>
<li><code>CUPS_CREDPURPOSE_CLIENT_AUTH</code> for validating TLS clients,
</li>
<li><code>CUPS_CREDPURPOSE_CODE_SIGNING</code> for validating compiled code,
</li>
<li><code>CUPS_CREDPURPOSE_EMAIL_PROTECTION</code> for validating email messages,
</li>
<li><code>CUPS_CREDPURPOSE_TIME_STAMPING</code> for signing timestamps to objects, and/or
</li>
<li><code>CUPS_CREDPURPOSE_OCSP_SIGNING</code> for Online Certificate Status Protocol
  message signing.</li>
</ul>
<p class="discussion">The &quot;allowed_usage&quot; argument specifies the allowed usage(s) for the
credentials as a bitwise OR of the following constants:

</p><ul>
<li><code>CUPS_CREDUSAGE_DIGITAL_SIGNATURE</code>: digital signatures,
</li>
<li><code>CUPS_CREDUSAGE_NON_REPUDIATION</code>: non-repudiation/content commitment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_ENCIPHERMENT</code>: key encipherment,
</li>
<li><code>CUPS_CREDUSAGE_DATA_ENCIPHERMENT</code>: data encipherment,
</li>
<li><code>CUPS_CREDUSAGE_KEY_AGREEMENT</code>: key agreement,
</li>
<li><code>CUPS_CREDUSAGE_KEY_CERT_SIGN</code>: key certicate signing,
</li>
<li><code>CUPS_CREDUSAGE_CRL_SIGN</code>: certificate revocation list signing,
</li>
<li><code>CUPS_CREDUSAGE_ENCIPHER_ONLY</code>: encipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DECIPHER_ONLY</code>: decipherment only,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_CA</code>: defaults for CA certificates,
</li>
<li><code>CUPS_CREDUSAGE_DEFAULT_TLS</code>: defaults for TLS certificates, and/or
</li>
<li><code>CUPS_CREDUSAGE_ALL</code>: all usages.</li>
</ul>
<p class="discussion">The &quot;cb&quot; and &quot;cb_data&quot; arguments specify a function and its data that are
used to validate any subjectAltName values in the signing request:

<pre>
bool san_cb(const char *common_name, const char *alt_name, void *cb_data) {
  ... return true if OK and false if not ...
}
</pre>

If <code>NULL</code>, a default validation function is used that allows &quot;localhost&quot; and
variations of the common name.<br>
<br>
The &quot;expiration_date&quot; argument specifies the expiration date and time as a
Unix <code>time_t</code> value in seconds.</p>
<h3 class="function"><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
<p class="description">Start a new document.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsStartDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, <span class="reserved">int</span> job_id, <span class="reserved">const</span> <span class="reserved">char</span> *docname, <span class="reserved">const</span> <span class="reserved">char</span> *format, size_t num_options, <a href="#cups_option_t">cups_option_t</a> *options, <span class="reserved">bool</span> last_document);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
<tr><th>docname</th>
<td class="description">Document name</td></tr>
<tr><th>format</th>
<td class="description">Document format</td></tr>
<tr><th>num_options</th>
<td class="description">Number of document options</td></tr>
<tr><th>options</th>
<td class="description">Document options</td></tr>
<tr><th>last_document</th>
<td class="description"><code>true</code> if this is the last document</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document creation</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function starts a new document for the specified destination &quot;dest&quot; and
job &quot;job_id&quot;.  The &quot;info&quot; argument contains information about the destination
obtained using the <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a> function.<br>
<br>
The &quot;docname&quot; argument specifies the name of the document/file being printed.
The &quot;format&quot; argument specifies the MIME media type for the document; the
following constants are provided for convenience:

</p><ul>
<li><code>CUPS_FORMAT_AUTO</code>: Auto-type the file using its contents
</li>
<li><code>CUPS_FORMAT_JPEG</code>: JPEG image file
</li>
<li><code>CUPS_FORMAT_PDF</code>: PDF file
</li>
<li><code>CUPS_FORMAT_TEXT</code>: Plain text file</li>
</ul>
<p class="discussion">The &quot;num_options&quot; and &quot;options&quot; arguments provide the options to be applied
to the document.  The &quot;last_document&quot; argument specifies whether this is the
final document in the job (<code>true</code>) or not (<code>false</code>).<br>
<br>
Returns <code>HTTP_CONTINUE</code> on success.</p>
<h3 class="function"><a id="cupsThreadCancel">cupsThreadCancel</a></h3>
<p class="description">Cancel (kill) a thread.</p>
<p class="code">
<span class="reserved">void</span> cupsThreadCancel(<a href="#cups_thread_t">cups_thread_t</a> thread);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>thread</th>
<td class="description">Thread ID</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsThreadCreate">cupsThreadCreate</a></h3>
<p class="description">Create a thread.</p>
<p class="code">
<a href="#cups_thread_t">cups_thread_t</a> cupsThreadCreate(<a href="#cups_thread_func_t">cups_thread_func_t</a> func, <span class="reserved">void</span> *arg);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>func</th>
<td class="description">Entry point</td></tr>
<tr><th>arg</th>
<td class="description">Entry point context</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Thread ID or <code>CUPS_THREAD_INVALID</code> on failure</p>
<h3 class="function"><a id="cupsThreadDetach">cupsThreadDetach</a></h3>
<p class="description">Tell the OS that the thread is running independently.</p>
<p class="code">
<span class="reserved">void</span> cupsThreadDetach(<a href="#cups_thread_t">cups_thread_t</a> thread);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>thread</th>
<td class="description">Thread ID</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsThreadWait">cupsThreadWait</a></h3>
<p class="description">Wait for a thread to exit.</p>
<p class="code">
<span class="reserved">void</span> *cupsThreadWait(<a href="#cups_thread_t">cups_thread_t</a> thread);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>thread</th>
<td class="description">Thread ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Return value</p>
<h3 class="function"><a id="cupsUTF32ToUTF8">cupsUTF32ToUTF8</a></h3>
<p class="description">Convert UTF-32 to UTF-8.</p>
<p class="code">
ssize_t cupsUTF32ToUTF8(<span class="reserved">char</span> *dest, <span class="reserved">const</span> <a href="#cups_utf32_t">cups_utf32_t</a> *src, <span class="reserved">const</span> size_t maxout);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Target string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>maxout</th>
<td class="description">Max output in bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes or <code>-1</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts a UTF-32 (32-bit encoding of Unicode) string to a
UTF-8 (8-bit encoding of Unicode) <code>nul</code>-terminated C string.</p>
<h3 class="function"><a id="cupsUTF8ToCharset">cupsUTF8ToCharset</a></h3>
<p class="description">Convert UTF-8 to legacy character set.</p>
<p class="code">
ssize_t cupsUTF8ToCharset(<span class="reserved">char</span> *dest, <span class="reserved">const</span> <span class="reserved">char</span> *src, <span class="reserved">const</span> size_t maxout, <span class="reserved">const</span> cups_encoding_t encoding);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Target string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>maxout</th>
<td class="description">Max output in bytes</td></tr>
<tr><th>encoding</th>
<td class="description">Encoding</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes or <code>-1</code> on error</p>
<h3 class="function"><a id="cupsUTF8ToUTF32">cupsUTF8ToUTF32</a></h3>
<p class="description">Convert UTF-8 to UTF-32.</p>
<p class="code">
ssize_t cupsUTF8ToUTF32(<a href="#cups_utf32_t">cups_utf32_t</a> *dest, <span class="reserved">const</span> <span class="reserved">char</span> *src, <span class="reserved">const</span> size_t maxout);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Target string</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>maxout</th>
<td class="description">Max output in words</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of words or <code>-1</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts a UTF-8 (8-bit encoding of Unicode) <code>nul</code>-terminated
C string to a UTF-32 (32-bit encoding of Unicode) string.</p>
<h3 class="function"><a id="cupsWriteRequestData">cupsWriteRequestData</a></h3>
<p class="description">Write additional data after an IPP request.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> cupsWriteRequestData(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>buffer</th>
<td class="description">Bytes to write</td></tr>
<tr><th>length</th>
<td class="description">Number of bytes to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>HTTP_STATUS_CONTINUE</code> if OK or HTTP status on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is used after <a href="#cupsSendRequest"><code>cupsSendRequest</code></a> to provide a PPD and
after <a href="#cupsStartDocument"><code>cupsStartDocument</code></a> to provide a document file.</p>
<h3 class="function"><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
<p class="description">Accept a new HTTP client connection.</p>
<p class="code">
<a href="#http_t">http_t</a> *httpAcceptConnection(<span class="reserved">int</span> fd, <span class="reserved">bool</span> blocking);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">Listen socket file descriptor</td></tr>
<tr><th>blocking</th>
<td class="description"><code>true</code> if the connection should be blocking, <code>false</code> otherwise</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP connection or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function accepts a new HTTP client connection from the specified
listening socket &quot;fd&quot;.  The &quot;blocking&quot; argument specifies whether the new
HTTP connection is blocking.</p>
<h3 class="function"><a id="httpAddrClose">httpAddrClose</a></h3>
<p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
                    <a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
<p class="code">
<span class="reserved">bool</span> httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, <span class="reserved">int</span> fd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Listen address or <code>NULL</code></td></tr>
<tr><th>fd</th>
<td class="description">Socket file descriptor</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> and the
listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>.  This function
ensures that domain sockets are removed when closed.</p>
<h3 class="function"><a id="httpAddrConnect">httpAddrConnect</a></h3>
<p class="description">Connect to any of the addresses in the list with a
                      timeout and optional cancel.</p>
<p class="code">
<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, <span class="reserved">int</span> *sock, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addrlist</th>
<td class="description">List of potential addresses</td></tr>
<tr><th>sock</th>
<td class="description">Socket</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connected address or NULL on failure</p>
<h3 class="function"><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
<p class="description">Copy an address list.</p>
<p class="code">
<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New address list or <code>NULL</code> on error</p>
<h3 class="function"><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
<p class="description">Free an address list.</p>
<p class="code">
<span class="reserved">void</span> httpAddrFreeList(<span class="reserved">void</span>);</p>
<h3 class="function"><a id="httpAddrGetFamily">httpAddrGetFamily</a></h3>
<p class="description">Get the address family of an address.</p>
<p class="code">
<span class="reserved">int</span> httpAddrGetFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Address family</p>
<h3 class="function"><a id="httpAddrGetLength">httpAddrGetLength</a></h3>
<p class="description">Return the length of the address in bytes.</p>
<p class="code">
size_t httpAddrGetLength(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Length in bytes</p>
<h3 class="function"><a id="httpAddrGetList">httpAddrGetList</a></h3>
<p class="description">Get a list of addresses for a hostname.</p>
<p class="code">
<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">List of addresses or NULL</p>
<h3 class="function"><a id="httpAddrGetPort">httpAddrGetPort</a></h3>
<p class="description">Get the port number associated with an address.</p>
<p class="code">
<span class="reserved">int</span> httpAddrGetPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Port number</p>
<h3 class="function"><a id="httpAddrGetString">httpAddrGetString</a></h3>
<p class="description">Convert an address to a numeric string.</p>
<p class="code">
<span class="reserved">char</span> *httpAddrGetString(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr, <span class="reserved">char</span> *s, size_t slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to convert</td></tr>
<tr><th>s</th>
<td class="description">String buffer</td></tr>
<tr><th>slen</th>
<td class="description">Length of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Numeric address string</p>
<h3 class="function"><a id="httpAddrIsAny">httpAddrIsAny</a></h3>
<p class="description">Check for the &quot;any&quot; address.</p>
<p class="code">
<span class="reserved">bool</span> httpAddrIsAny(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to check</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if &quot;any&quot;, <code>false</code> otherwise</p>
<h3 class="function"><a id="httpAddrIsEqual">httpAddrIsEqual</a></h3>
<p class="description">Compare two addresses.</p>
<p class="code">
<span class="reserved">bool</span> httpAddrIsEqual(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr1, <span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr2);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr1</th>
<td class="description">First address</td></tr>
<tr><th>addr2</th>
<td class="description">Second address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if equal, <code>false</code> if not</p>
<h3 class="function"><a id="httpAddrIsLocalhost">httpAddrIsLocalhost</a></h3>
<p class="description">Check for the local loopback address.</p>
<p class="code">
<span class="reserved">bool</span> httpAddrIsLocalhost(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to check</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if local host, <code>false</code> otherwise</p>
<h3 class="function"><a id="httpAddrListen">httpAddrListen</a></h3>
<p class="description">Create a listening socket bound to the specified address and port.</p>
<p class="code">
<span class="reserved">int</span> httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, <span class="reserved">int</span> port);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to bind to</td></tr>
<tr><th>port</th>
<td class="description">Port number to bind to</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Socket or <code>-1</code> on error</p>
<h3 class="function"><a id="httpAddrLookup">httpAddrLookup</a></h3>
<p class="description">Lookup the hostname associated with the address.</p>
<p class="code">
<span class="reserved">char</span> *httpAddrLookup(<span class="reserved">const</span> <a href="#http_addr_t">http_addr_t</a> *addr, <span class="reserved">char</span> *name, size_t namelen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to lookup</td></tr>
<tr><th>name</th>
<td class="description">Host name buffer</td></tr>
<tr><th>namelen</th>
<td class="description">Size of name buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Host name</p>
<h3 class="function"><a id="httpAddrSetPort">httpAddrSetPort</a></h3>
<p class="description">Set the port number associated with an address.</p>
<p class="code">
<span class="reserved">void</span> httpAddrSetPort(<a href="#http_addr_t">http_addr_t</a> *addr, <span class="reserved">int</span> port);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
<tr><th>port</th>
<td class="description">Port</td></tr>
</tbody></table>
<h3 class="function"><a id="httpAssembleURI">httpAssembleURI</a></h3>
<p class="description">Assemble a uniform resource identifier from its
                      components.</p>
<p class="code">
<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, <span class="reserved">char</span> *uri, size_t urilen, <span class="reserved">const</span> <span class="reserved">char</span> *scheme, <span class="reserved">const</span> <span class="reserved">char</span> *username, <span class="reserved">const</span> <span class="reserved">char</span> *host, <span class="reserved">int</span> port, <span class="reserved">const</span> <span class="reserved">char</span> *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>encoding</th>
<td class="description">Encoding flags</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme name</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>host</th>
<td class="description">Hostname or address</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>resource</th>
<td class="description">Resource</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">URI status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function escapes reserved characters in the URI depending on the
value of the &quot;encoding&quot; argument.  You should use this function in
place of traditional string functions whenever you need to create a
URI string.</p>
<h3 class="function"><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
<p class="description">Assemble a uniform resource identifier from its
                       components with a formatted resource.</p>
<p class="code">
<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, <span class="reserved">char</span> *uri, size_t urilen, <span class="reserved">const</span> <span class="reserved">char</span> *scheme, <span class="reserved">const</span> <span class="reserved">char</span> *username, <span class="reserved">const</span> <span class="reserved">char</span> *host, <span class="reserved">int</span> port, <span class="reserved">const</span> <span class="reserved">char</span> *resourcef, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>encoding</th>
<td class="description">Encoding flags</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme name</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>host</th>
<td class="description">Hostname or address</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>resourcef</th>
<td class="description">Printf-style resource</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">URI status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a formatted version of the resource string
argument &quot;resourcef&quot; and escapes reserved characters in the URI
depending on the value of the &quot;encoding&quot; argument.  You should use
this function in place of traditional string functions whenever
you need to create a URI string.</p>
<h3 class="function"><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
<p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
<p class="code">
<span class="reserved">char</span> *httpAssembleUUID(<span class="reserved">const</span> <span class="reserved">char</span> *server, <span class="reserved">int</span> port, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">int</span> number, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>server</th>
<td class="description">Server name</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>name</th>
<td class="description">Object name or NULL</td></tr>
<tr><th>number</th>
<td class="description">Object number or 0</td></tr>
<tr><th>buffer</th>
<td class="description">String buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">UUID string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a unique 128-bit identifying number using the server
name, port number, random data, and optionally an object name and/or object
number.  The result is formatted as a UUID URN as defined in RFC 4122.<br>
<br>
The buffer needs to be at least 46 bytes in size.</p>
<h3 class="function"><a id="httpClearCookie">httpClearCookie</a></h3>
<p class="description">Clear the cookie value(s).</p>
<p class="code">
<span class="reserved">void</span> httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
<p class="description">Clear HTTP request/response fields.</p>
<p class="code">
<span class="reserved">void</span> httpClearFields(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpClose">httpClose</a></h3>
<p class="description">Close a HTTP connection.</p>
<p class="code">
<span class="reserved">void</span> httpClose(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpConnect">httpConnect</a></h3>
<p class="description">Connect to a HTTP server.</p>
<p class="code">
<a href="#http_t">http_t</a> *httpConnect(<span class="reserved">const</span> <span class="reserved">char</span> *host, <span class="reserved">int</span> port, <a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, <span class="reserved">int</span> family, <a href="#http_encryption_t">http_encryption_t</a> encryption, <span class="reserved">bool</span> blocking, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>host</th>
<td class="description">Host to connect to</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>addrlist</th>
<td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
<tr><th>family</th>
<td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
<tr><th>encryption</th>
<td class="description">Type of encryption to use</td></tr>
<tr><th>blocking</th>
<td class="description"><code>true</code> for blocking connection, <code>false</code> for non-blocking</td></tr>
<tr><th>msec</th>
<td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New HTTP connection</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a connection to a HTTP server.  The &quot;host&quot; and &quot;port&quot;
arguments specify a hostname or IP address and port number to use while the
&quot;addrlist&quot; argument specifies a list of addresses to use or <code>NULL</code> to do a
fresh lookup.  The &quot;family&quot; argument specifies the address family to use -
<code>AF_UNSPEC</code> to try both IPv4 and IPv6, <code>AF_INET</code> for IPv4, or <code>AF_INET6</code> for
IPv6.<br>
<br>
The &quot;encryption&quot; argument specifies whether to encrypt the connection and the
&quot;blocking&quot; argument specifies whether to use blocking behavior when reading
or writing data.<br>
<br>
The &quot;msec&quot; argument specifies how long to try to connect to the server or <code>0</code>
to just create an unconnected <code>http_t</code> object.  The &quot;cancel&quot; argument
specifies an integer variable that can be set to a non-zero value to cancel
the connection process.</p>
<h3 class="function"><a id="httpConnectAgain">httpConnectAgain</a></h3>
<p class="description">Reconnect to a HTTP server with timeout and optional cancel variable.</p>
<p class="code">
<span class="reserved">bool</span> httpConnectAgain(<a href="#http_t">http_t</a> *http, <span class="reserved">int</span> msec, <span class="reserved">int</span> *cancel);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="httpCopyPeerCredentials">httpCopyPeerCredentials</a></h3>
<p class="description">Copy the credentials associated with the peer in an encrypted connection.</p>
<p class="code">
<span class="reserved">char</span> *httpCopyPeerCredentials(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">PEM-encoded X.509 certificate chain or <code>NULL</code></p>
<h3 class="function"><a id="httpDecode64">httpDecode64</a></h3>
<p class="description">Base64-decode a string.</p>
<p class="code">
<span class="reserved">char</span> *httpDecode64(<span class="reserved">char</span> *out, size_t *outlen, <span class="reserved">const</span> <span class="reserved">char</span> *in, <span class="reserved">const</span> <span class="reserved">char</span> **end);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>out</th>
<td class="description">String to write to</td></tr>
<tr><th>outlen</th>
<td class="description">Size of output string</td></tr>
<tr><th>in</th>
<td class="description">String to read from</td></tr>
<tr><th>end</th>
<td class="description">Pointer to end of Base64 data (<code>NULL</code> if don't care)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Decoded string or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function decodes a Base64 string as defined by RFC 4648.  The caller
must initialize &quot;outlen&quot; to the maximum size of the decoded string.  On
return &quot;outlen&quot; contains the decoded length of the string and &quot;end&quot; (if not
<code>NULL</code>) points to the end of the Base64 data that has been decoded.<br>
<br>
This function always reserves one byte in the output buffer for a nul
terminating character, even if the result is not a regular string.  Callers
should ensure that the output buffer is at least one byte larger than the
expected size, for example 33 bytes for a SHA-256 hash which is 32 bytes in
length.<br>
<br>
This function supports both Base64 and Base64url strings.</p>
<h3 class="function"><a id="httpEncode64">httpEncode64</a></h3>
<p class="description">Base64-encode a string.</p>
<p class="code">
<span class="reserved">char</span> *httpEncode64(<span class="reserved">char</span> *out, size_t outlen, <span class="reserved">const</span> <span class="reserved">char</span> *in, size_t inlen, <span class="reserved">bool</span> url);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>out</th>
<td class="description">String to write to</td></tr>
<tr><th>outlen</th>
<td class="description">Maximum size of output string</td></tr>
<tr><th>in</th>
<td class="description">String to read from</td></tr>
<tr><th>inlen</th>
<td class="description">Size of input string</td></tr>
<tr><th>url</th>
<td class="description"><code>true</code> for Base64url, <code>false</code> for Base64</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Encoded string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function encodes a Base64 string as defined by RFC 4648.  The &quot;url&quot;
parameter controls whether the original Base64 (&quot;url&quot; = <code>false</code>) or the
Base64url (&quot;url&quot; = <code>true</code>) alphabet is used.</p>
<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
<p class="description">Return the HTTP field enumeration value for a field
                     name.</p>
<p class="code">
<a href="#http_field_t">http_field_t</a> httpFieldValue(<span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">String name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Field index</p>
<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
<p class="description">Flush data read from a HTTP connection.</p>
<p class="code">
<span class="reserved">void</span> httpFlush(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpFlushWrite">httpFlushWrite</a></h3>
<p class="description">Flush data written to a HTTP connection.</p>
<p class="code">
<span class="reserved">int</span> httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Bytes written or -1 on error</p>
<h3 class="function"><a id="httpGetActivity">httpGetActivity</a></h3>
<p class="description">Get the most recent activity for a connection.</p>
<p class="code">
time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Time of last read or write</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The return value is the time in seconds of the last read or write.</p>
<h3 class="function"><a id="httpGetAddress">httpGetAddress</a></h3>
<p class="description">Get the address of the connected peer of a connection.</p>
<p class="code">
<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connected address or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
server.  For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
the client.<br>
<br>
Returns <code>NULL</code> if the socket is currently unconnected.</p>
<h3 class="function"><a id="httpGetAuthString">httpGetAuthString</a></h3>
<p class="description">Get the current authorization string.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Authorization string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>.  Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
<code>HTTP_FIELD_AUTHORIZATION</code> value.</p>
<h3 class="function"><a id="httpGetBlocking">httpGetBlocking</a></h3>
<p class="description">Get the blocking/non-blocking state of a connection.</p>
<p class="code">
<span class="reserved">bool</span> httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if blocking, <code>false</code> if non-blocking</p>
<h3 class="function"><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
<p class="description">Get a common content encoding, if any, between
                             the client and server.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Content-Coding value or <code>NULL</code> for the identity coding.</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
called after receiving a response from the server or a request from the
client.  The value returned can be use in subsequent requests (for clients)
or in the response (for servers) in order to compress the content stream.</p>
<h3 class="function"><a id="httpGetCookie">httpGetCookie</a></h3>
<p class="description">Get any cookie data from the response.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Cookie data or <code>NULL</code></p>
<h3 class="function"><a id="httpGetDateString">httpGetDateString</a></h3>
<p class="description">Get a formatted date/time string from a time value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetDateString(time_t t, <span class="reserved">char</span> *s, size_t slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>t</th>
<td class="description">Time in seconds</td></tr>
<tr><th>s</th>
<td class="description">String buffer</td></tr>
<tr><th>slen</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Date/time string</p>
<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
<p class="description">Get a time value from a formatted date/time string.</p>
<p class="code">
time_t httpGetDateTime(<span class="reserved">const</span> <span class="reserved">char</span> *s);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">Date/time string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Time in seconds</p>
<h3 class="function"><a id="httpGetEncryption">httpGetEncryption</a></h3>
<p class="description">Get the current encryption mode of a connection.</p>
<p class="code">
<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current encryption mode</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the encryption mode for the connection. Use the
<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
been established.</p>
<h3 class="function"><a id="httpGetError">httpGetError</a></h3>
<p class="description">Get the last error on a connection.</p>
<p class="code">
<span class="reserved">int</span> httpGetError(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Error code (errno) value</p>
<h3 class="function"><a id="httpGetExpect">httpGetExpect</a></h3>
<p class="description">Get the value of the Expect header, if any.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Expect: status, if any</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.</p>
<h3 class="function"><a id="httpGetFd">httpGetFd</a></h3>
<p class="description">Get the file descriptor associated with a connection.</p>
<p class="code">
<span class="reserved">int</span> httpGetFd(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">File descriptor or -1 if none</p>
<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
<p class="description">Get a field value from a request/response.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field to get</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Field value</p>
<h3 class="function"><a id="httpGetHostname">httpGetHostname</a></h3>
<p class="description">Get the FQDN for the connection or local system.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpGetHostname(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *s, size_t slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection or NULL</td></tr>
<tr><th>s</th>
<td class="description">String buffer for name</td></tr>
<tr><th>slen</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">FQDN for connection or system</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or address that
was used in the call to <a href="#httpConnect"><code>httpConnect</code></a> or the address of the client for
the connection from <a href="#httpAcceptConnection"><code>httpAcceptConnection</code></a>.<br>
<br>
When &quot;http&quot; is <code>NULL</code>, return the FQDN for the local system.</p>
<h3 class="function"><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
<p class="description">Get the current Keep-Alive state of the connection.</p>
<p class="code">
<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Keep-Alive state</p>
<h3 class="function"><a id="httpGetLength">httpGetLength</a></h3>
<p class="description">Get the amount of data remaining from the content-length
                    or transfer-encoding fields.</p>
<p class="code">
off_t httpGetLength(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Content length</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the complete content length, even for content larger
than 2^31 - 1.</p>
<h3 class="function"><a id="httpGetPending">httpGetPending</a></h3>
<p class="description">Get the number of bytes that are buffered for writing.</p>
<p class="code">
size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes buffered</p>
<h3 class="function"><a id="httpGetReady">httpGetReady</a></h3>
<p class="description">Get the number of bytes that can be read without blocking.</p>
<p class="code">
size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes available</p>
<h3 class="function"><a id="httpGetRemaining">httpGetRemaining</a></h3>
<p class="description">Get the number of remaining bytes in the message
                       body or current chunk.</p>
<p class="code">
size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Remaining bytes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
message body is chunked or fixed-length.</p>
<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
<p class="description">Get the current state of the HTTP request.</p>
<p class="code">
<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP state</p>
<h3 class="function"><a id="httpGetStatus">httpGetStatus</a></h3>
<p class="description">Get the status of the last HTTP request.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h3 class="function"><a id="httpGetSubField">httpGetSubField</a></h3>
<p class="description">Get a sub-field value.</p>
<p class="code">
<span class="reserved">char</span> *httpGetSubField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">char</span> *value, size_t valuelen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>name</th>
<td class="description">Name of sub-field</td></tr>
<tr><th>value</th>
<td class="description">Value string</td></tr>
<tr><th>valuelen</th>
<td class="description">Size of value buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value or <code>NULL</code></p>
<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
<p class="description">Get the HTTP version at the other end.</p>
<p class="code">
<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Version number</p>
<h3 class="function"><a id="httpGets">httpGets</a></h3>
<p class="description">Get a line of text from a HTTP connection.</p>
<p class="code">
<span class="reserved">char</span> *httpGets(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *line, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>line</th>
<td class="description">Line to read into</td></tr>
<tr><th>length</th>
<td class="description">Max length of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Line or <code>NULL</code></p>
<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
<p class="description">Initialize the HTTP interface library and set the default HTTP proxy (if any).</p>
<p class="code">
<span class="reserved">void</span> httpInitialize(<span class="reserved">void</span>);</p>
<h3 class="function"><a id="httpIsChunked">httpIsChunked</a></h3>
<p class="description">Report whether a message body is chunked.</p>
<p class="code">
<span class="reserved">bool</span> httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if chunked, <code>false</code> if not</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>true</code> if the message body is composed of
variable-length chunks.</p>
<h3 class="function"><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
<p class="description">Report whether a connection is encrypted.</p>
<p class="code">
<span class="reserved">bool</span> httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if encrypted, <code>false</code> if not</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>true</code> if the connection is currently encrypted.</p>
<h3 class="function"><a id="httpPeek">httpPeek</a></h3>
<p class="description">Peek at data from a HTTP connection.</p>
<p class="code">
ssize_t httpPeek(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Maximum number of bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes copied</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies available data from the given HTTP connection, reading
a buffer as needed.  The data is still available for reading using
<a href="#httpRead"><code>httpRead</code></a>.<br>
<br>
For non-blocking connections the usual timeouts apply.</p>
<h3 class="function"><a id="httpPrintf">httpPrintf</a></h3>
<p class="description">Print a formatted string to a HTTP connection.</p>
<p class="code">
ssize_t httpPrintf(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>format</th>
<td class="description">printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional args as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written or <code>-1</code> on error</p>
<h3 class="function"><a id="httpRead">httpRead</a></h3>
<p class="description">Read data from a HTTP connection.</p>
<p class="code">
ssize_t httpRead(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Maximum number of bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes read</p>
<h3 class="function"><a id="httpReadRequest">httpReadRequest</a></h3>
<p class="description">Read a HTTP request from a connection.</p>
<p class="code">
<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *uri, size_t urilen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New state of connection</p>
<h3 class="function"><a id="httpResolveHostname">httpResolveHostname</a></h3>
<p class="description">Resolve the hostname of the HTTP connection
                          address.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpResolveHostname(<a href="#http_t">http_t</a> *http, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Hostname buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Resolved hostname or <code>NULL</code></p>
<h3 class="function"><a id="httpResolveURI">httpResolveURI</a></h3>
<p class="description">Resolve a DNS-SD URI.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpResolveURI(<span class="reserved">const</span> <span class="reserved">char</span> *uri, <span class="reserved">char</span> *resolved_uri, size_t resolved_size, <a href="#http_resolve_t">http_resolve_t</a> options, <a href="#http_resolve_cb_t">http_resolve_cb_t</a> cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>uri</th>
<td class="description">DNS-SD URI</td></tr>
<tr><th>resolved_uri</th>
<td class="description">Buffer for resolved URI</td></tr>
<tr><th>resolved_size</th>
<td class="description">Size of URI buffer</td></tr>
<tr><th>options</th>
<td class="description">Resolve options</td></tr>
<tr><th>cb</th>
<td class="description">Continue callback function</td></tr>
<tr><th>cb_data</th>
<td class="description">Context pointer for callback</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Resolved URI</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function resolves a DNS-SD URI of the form
&quot;scheme://service-instance-name._protocol._tcp.domain/...&quot;.  The &quot;options&quot;
parameter specifies a bitfield of resolution options including:

</p><ul>
<li><code>HTTP_RESOLVE_DEFAULT</code>: Use default options
</li>
<li><code>HTTP_RESOLVE_FQDN</code>: Resolve the fully-qualified domain name instead of an IP address
</li>
<li><code>HTTP_RESOLVE_FAXOUT</code>: Resolve the FaxOut service instead of Print (IPP/IPPS)</li>
</ul>
<p class="discussion">The &quot;cb&quot; parameter specifies a callback that allows resolution to be
terminated.  The callback is provided the &quot;cb_data&quot; value and returns a
<code>bool</code> value that is <code>true</code> to continue and <code>false</code> to stop.  If no callback
is specified (&quot;cb&quot; is <code>NULL</code>), then this function will block up to 90 seconds
to resolve the specified URI.</p>
<h3 class="function"><a id="httpSeparateURI">httpSeparateURI</a></h3>
<p class="description">Separate a Universal Resource Identifier into its
                      components.</p>
<p class="code">
<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding, <span class="reserved">const</span> <span class="reserved">char</span> *uri, <span class="reserved">char</span> *scheme, size_t schemelen, <span class="reserved">char</span> *username, size_t usernamelen, <span class="reserved">char</span> *host, size_t hostlen, <span class="reserved">int</span> *port, <span class="reserved">char</span> *resource, size_t resourcelen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>decoding</th>
<td class="description">Decoding flags</td></tr>
<tr><th>uri</th>
<td class="description">Universal Resource Identifier</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme (http, https, etc.)</td></tr>
<tr><th>schemelen</th>
<td class="description">Size of scheme buffer</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>usernamelen</th>
<td class="description">Size of username buffer</td></tr>
<tr><th>host</th>
<td class="description">Hostname</td></tr>
<tr><th>hostlen</th>
<td class="description">Size of hostname buffer</td></tr>
<tr><th>port</th>
<td class="description">Port number to use</td></tr>
<tr><th>resource</th>
<td class="description">Resource/filename</td></tr>
<tr><th>resourcelen</th>
<td class="description">Size of resource buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Result of separation</p>
<h3 class="function"><a id="httpSetAuthString">httpSetAuthString</a></h3>
<p class="description">Set the current authorization string.</p>
<p class="code">
<span class="reserved">void</span> httpSetAuthString(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *scheme, <span class="reserved">const</span> <span class="reserved">char</span> *data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>scheme</th>
<td class="description">Auth scheme (<code>NULL</code> to clear it)</td></tr>
<tr><th>data</th>
<td class="description">Auth data (<code>NULL</code> for none)</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function stores a copy of the current authorization string in the HTTP
connection object.  You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
<a href="#httpWriteRequest"><code>httpWriteRequest</code></a>.</p>
<h3 class="function"><a id="httpSetBlocking">httpSetBlocking</a></h3>
<p class="description">Set blocking/non-blocking behavior on a connection.</p>
<p class="code">
<span class="reserved">void</span> httpSetBlocking(<a href="#http_t">http_t</a> *http, <span class="reserved">bool</span> blocking);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>blocking</th>
<td class="description"><code>true</code> = blocking, <code>false</code> = non-blocking</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets whether a connection uses blocking behavior when reading
or writing data.  The &quot;http&quot; argument specifies the HTTP connection and the
&quot;blocking&quot; argument specifies whether to use blocking behavior.</p>
<h3 class="function"><a id="httpSetCookie">httpSetCookie</a></h3>
<p class="description">Set the cookie value(s).</p>
<p class="code">
<span class="reserved">void</span> httpSetCookie(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *cookie);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection</td></tr>
<tr><th>cookie</th>
<td class="description">Cookie string</td></tr>
</tbody></table>
<h3 class="function"><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
<p class="description">Set the default value of a HTTP header.</p>
<p class="code">
<span class="reserved">void</span> httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the default value for a HTTP header.<br>
<br>
</p><blockquote>
<em>Note:</em> Currently only the <code>HTTP_FIELD_ACCEPT_ENCODING</code>,
<code>HTTP_FIELD_SERVER</code>, and <code>HTTP_FIELD_USER_AGENT</code> fields can be set.</blockquote>
<h3 class="function"><a id="httpSetEncryption">httpSetEncryption</a></h3>
<p class="description">Set the required encryption on a HTTP connection.</p>
<p class="code">
<span class="reserved">bool</span> httpSetEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>e</th>
<td class="description">New encryption preference</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="httpSetExpect">httpSetExpect</a></h3>
<p class="description">Set the Expect: header in a request.</p>
<p class="code">
<span class="reserved">void</span> httpSetExpect(<a href="#http_t">http_t</a> *http, <a href="#http_status_t">http_status_t</a> expect);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>expect</th>
<td class="description">HTTP status to expect (<code>HTTP_STATUS_NONE</code> or <code>HTTP_STATUS_CONTINUE</code>)</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the <code>Expect:</code> header in a request.  Currently only
<code>HTTP_STATUS_NONE</code> or <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
argument.</p>
<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
<p class="description">Set the value of a HTTP header.</p>
<p class="code">
<span class="reserved">void</span> httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h3 class="function"><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
<p class="description">Set the current Keep-Alive state of a connection.</p>
<p class="code">
<span class="reserved">void</span> httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>keep_alive</th>
<td class="description">New Keep-Alive value</td></tr>
</tbody></table>
<h3 class="function"><a id="httpSetLength">httpSetLength</a></h3>
<p class="description">Set the <code>Content-Length</code> and <code>Transfer-Encoding</code> fields.</p>
<p class="code">
<span class="reserved">void</span> httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>length</th>
<td class="description">Length (<code>0</code> for chunked)</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the <code>Content-Length</code> and <code>Transfer-Encoding</code> fields.
Passing <code>0</code> to the &quot;length&quot; argument specifies a chunked transfer encoding
while other values specify a fixed <code>Content-Length</code>.</p>
<h3 class="function"><a id="httpSetTimeout">httpSetTimeout</a></h3>
<p class="description">Set read/write timeouts and an optional callback.</p>
<p class="code">
<span class="reserved">void</span> httpSetTimeout(<a href="#http_t">http_t</a> *http, <span class="reserved">double</span> timeout, <a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>timeout</th>
<td class="description">Number of seconds for timeout, must be greater than <code>0</code></td></tr>
<tr><th>cb</th>
<td class="description">Callback function or <code>NULL</code> for none</td></tr>
<tr><th>cb_data</th>
<td class="description">Callback data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the read/write timeouts for a HTTP connection with an
optional timeout callback.  The timeout callback receives both the HTTP
connection pointer and a user data pointer, and returns <code>true</code> to continue or
<code>false</code> to error (time) out.

<pre>
bool // true to continue, false to stop
timeout_cb(http_t *http, void *user_data)
{
  ... &quot;http&quot; contains the HTTP connection, &quot;user_data&quot; contains the callback pointer
}
</pre>
</p>
<h3 class="function"><a id="httpShutdown">httpShutdown</a></h3>
<p class="description">Shutdown one side of a HTTP connection.</p>
<p class="code">
<span class="reserved">void</span> httpShutdown(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpStateString">httpStateString</a></h3>
<p class="description">Return the string describing a HTTP state value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>state</th>
<td class="description">HTTP state value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">State string</p>
<h3 class="function"><a id="httpStatusString">httpStatusString</a></h3>
<p class="description">Return a short string describing a HTTP status code.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpStatusString(<a href="#http_status_t">http_status_t</a> status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>status</th>
<td class="description">HTTP status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized status string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns a short (localized) string describing a HTTP status
code.  The strings are taken from the IANA HTTP Status Code registry.</p>
<h3 class="function"><a id="httpURIStatusString">httpURIStatusString</a></h3>
<p class="description">Return a string describing a URI status value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>status</th>
<td class="description">URI status value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized status string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns a short (localized) string describing a URI status
value.</p>
<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
<p class="description">Update the current HTTP state for incoming data.</p>
<p class="code">
<a href="#http_status_t">http_status_t</a> httpUpdate(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h3 class="function"><a id="httpWait">httpWait</a></h3>
<p class="description">Wait for data available on a connection.</p>
<p class="code">
<span class="reserved">bool</span> httpWait(<a href="#http_t">http_t</a> *http, <span class="reserved">int</span> msec);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>msec</th>
<td class="description">Milliseconds to wait</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> when data is available, <code>false</code> otherwise</p>
<h3 class="function"><a id="httpWrite">httpWrite</a></h3>
<p class="description">Write data to a HTTP connection.</p>
<p class="code">
ssize_t httpWrite(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Number of bytes to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">TODO: Expand this documentation to talk about chunking.</p>
<h3 class="function"><a id="httpWriteRequest">httpWriteRequest</a></h3>
<p class="description">Write a HTTP request.</p>
<p class="code">
<span class="reserved">bool</span> httpWriteRequest(<a href="#http_t">http_t</a> *http, <span class="reserved">const</span> <span class="reserved">char</span> *method, <span class="reserved">const</span> <span class="reserved">char</span> *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>method</th>
<td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;, etc.)</td></tr>
<tr><th>uri</th>
<td class="description">Request URI</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function writes a HTTP request to the specified connection.  The
&quot;method&quot; parameter specifies the HTTP method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;, etc)
while the &quot;uri&quot; parameter specifies the request URI.  All fields must be
set using the <a href="#httpSetCookie"><code>httpSetCookie</code></a>, <a href="#httpSetField"><code>httpSetField</code></a>, and
<a href="#httpSetLength"><code>httpSetLength</code></a> functions prior to writing the request.</p>
<h3 class="function"><a id="httpWriteResponse">httpWriteResponse</a></h3>
<p class="description">Write a HTTP response to a client connection.</p>
<p class="code">
<span class="reserved">bool</span> httpWriteResponse(<a href="#http_t">http_t</a> *http, <a href="#http_status_t">http_status_t</a> status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>status</th>
<td class="description">Status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
<p class="description">Add a boolean attribute to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">bool</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
<p class="description">Add an array of boolean values.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <span class="reserved">const</span> <span class="reserved">bool</span> *values);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddCollection">ippAddCollection</a></h3>
<p class="description">Add a collection value.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <a href="#ipp_t">ipp_t</a> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddCollections">ippAddCollections</a></h3>
<p class="description">Add an array of collection values.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <span class="reserved">const</span> <a href="#ipp_t">ipp_t</a> **values);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddCredentialsString">ippAddCredentialsString</a></h3>
<p class="description">Add a credentials string attribute to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCredentialsString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Attribute name</td></tr>
<tr><th>credentials</th>
<td class="description">Credentials string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds a 1setOf text attribute to an IPP message corresponding to
the specified credentials string.<br>
<br>
The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
<p class="description">Add a dateTime attribute to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <a href="#ipp_uchar_t">ipp_uchar_t</a> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
<p class="description">Add a integer attribute to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">int</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds an integer or enum attribute to an IPP message.<br>
<br>
The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
(<code>IPP_TAG_INTEGER</code>).</p>
<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
<p class="description">Add an array of integer values.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <span class="reserved">const</span> <span class="reserved">int</span> *values);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
(<code>IPP_TAG_INTEGER</code>).</p>
<h3 class="function"><a id="ippAddOctetString">ippAddOctetString</a></h3>
<p class="description">Add an octetString value to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">void</span> *data, size_t datalen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>data</th>
<td class="description">octetString data</td></tr>
<tr><th>datalen</th>
<td class="description">Length of data in bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
<p class="description">Add an out-of-band value to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported out-of-band values include unsupported-value
(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
admin-define (<code>IPP_TAG_ADMINDEFINE</code>).</p>
<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
<p class="description">Add a range of values to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">int</span> lower, <span class="reserved">int</span> upper);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>lower</th>
<td class="description">Lower value</td></tr>
<tr><th>upper</th>
<td class="description">Upper value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
The &quot;lower<code> parameter must be less than or equal to the </code>upper&quot; parameter.</p>
<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
<p class="description">Add ranges of values to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <span class="reserved">const</span> <span class="reserved">int</span> *lower, <span class="reserved">const</span> <span class="reserved">int</span> *upper);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>lower</th>
<td class="description">Lower values</td></tr>
<tr><th>upper</th>
<td class="description">Upper values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
<p class="description">Add a resolution value to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, <a href="#ipp_res_t">ipp_res_t</a> units, <span class="reserved">int</span> xres, <span class="reserved">int</span> yres);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
<tr><th>xres</th>
<td class="description">X resolution</td></tr>
<tr><th>yres</th>
<td class="description">Y resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
<p class="description">Add resolution values to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <a href="#ipp_res_t">ipp_res_t</a> units, <span class="reserved">const</span> <span class="reserved">int</span> *xres, <span class="reserved">const</span> <span class="reserved">int</span> *yres);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
<tr><th>xres</th>
<td class="description">X resolutions</td></tr>
<tr><th>yres</th>
<td class="description">Y resolutions</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
<p class="description">Add a group separator to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
<p class="description">Add a language-encoded string to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *language, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (`IPP_TAG_TEXT`), textWithLanguage
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).

The "language" parameter must be non-`NULL` for nameWithLanguage and
textWithLanguage string values and must be `NULL` for all other string values.</code></p>
<h3 class="function"><a id="ippAddStringf">ippAddStringf</a></h3>
<p class="description">Add a formatted string to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *language, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document
(<code>IPP_TAG_DOCUMENT</code>), event notification
(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (`IPP_TAG_TEXT`), textWithLanguage
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).

The "language" parameter must be non-`NULL` for nameWithLanguage
and textWithLanguage string values and must be `NULL` for all other
string values.

The "format" parameter uses formatting characters compatible with the
printf family of standard functions.  Additional arguments follow it as
needed.  The formatted string is truncated as needed to the maximum length of
the corresponding value type.</code></p>
<h3 class="function"><a id="ippAddStringfv">ippAddStringfv</a></h3>
<p class="description">Add a formatted string to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *language, <span class="reserved">const</span> <span class="reserved">char</span> *format, va_list ap);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>ap</th>
<td class="description">Additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document
(<code>IPP_TAG_DOCUMENT</code>), event notification
(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (`IPP_TAG_TEXT`), textWithLanguage
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).

The "language" parameter must be non-`NULL` for nameWithLanguage
and textWithLanguage string values and must be `NULL` for all other
string values.

The "format" parameter uses formatting characters compatible with the
printf family of standard functions.  Additional arguments are passed in the
stdarg pointer "ap".  The formatted string is truncated as needed to the
maximum length of the corresponding value type.</code></p>
<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
<p class="description">Add language-encoded strings to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, <span class="reserved">const</span> <span class="reserved">char</span> *name, size_t num_values, <span class="reserved">const</span> <span class="reserved">char</span> *language, <span class="reserved">const</span> <span class="reserved">char</span> *const *values);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (`IPP_TAG_TEXT`), textWithLanguage
(`IPP_TAG_TEXTLANG`), uri (`IPP_TAG_URI`), and uriScheme
(`IPP_TAG_URISCHEME`).

The "language" parameter must be non-`NULL` for nameWithLanguage and
textWithLanguage string values and must be `NULL` for all other string values.</code></p>
<h3 class="function"><a id="ippAttributeString">ippAttributeString</a></h3>
<p class="description">Convert the attribute's value to a string.</p>
<p class="code">
size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>buffer</th>
<td class="description">String buffer or NULL</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes less <code>nul</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts an attribute's values into a string and returns the
number of bytes that would be written, not including the trailing <code>nul</code>.  The
buffer pointer can be NULL to get the required length, just like
<code>(v)snprintf</code>.</p>
<h3 class="function"><a id="ippContainsInteger">ippContainsInteger</a></h3>
<p class="description">Determine whether an attribute contains the
                         specified value or is within the list of ranges.</p>
<p class="code">
<span class="reserved">bool</span> ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, <span class="reserved">int</span> value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>value</th>
<td class="description">Integer/enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on a match, <code>false</code> on no match</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>true</code> when the attribute contains either a matching
integer or enum value, or the value falls within one of the rangeOfInteger
values for the attribute.</p>
<h3 class="function"><a id="ippContainsString">ippContainsString</a></h3>
<p class="description">Determine whether an attribute contains the
                        specified string value.</p>
<p class="code">
<span class="reserved">bool</span> ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>value</th>
<td class="description">String value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on a match, <code>false</code> on no match</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns <code>true</code> when the attribute contains a matching charset,
keyword, naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.</p>
<h3 class="function"><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
<p class="description">Copy an attribute.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr, <span class="reserved">bool</span> quickcopy);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination IPP message</td></tr>
<tr><th>srcattr</th>
<td class="description">Attribute to copy</td></tr>
<tr><th>quickcopy</th>
<td class="description"><code>true</code> for a referenced copy, <code>false</code> for a new copy</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies an attribute to another IPP message.  When &quot;quickcopy&quot;
is <code>true</code>, a shallow reference copy of the attribute is created - this should
only be done as long as the original source IPP message will not be freed for
the life of the destination.</p>
<h3 class="function"><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
<p class="description">Copy attributes from one IPP message to another.</p>
<p class="code">
<span class="reserved">bool</span> ippCopyAttributes(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_t">ipp_t</a> *src, <span class="reserved">bool</span> quickcopy, <a href="#ipp_copy_cb_t">ipp_copy_cb_t</a> cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination IPP message</td></tr>
<tr><th>src</th>
<td class="description">Source IPP message</td></tr>
<tr><th>quickcopy</th>
<td class="description"><code>true</code> for a referenced copy, <code>false</code> for a new copy</td></tr>
<tr><th>cb</th>
<td class="description">Copy callback or <code>NULL</code> for none</td></tr>
<tr><th>cb_data</th>
<td class="description">Callback data pointer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies zero or more attributes from the source to the
destination IPP message.  When &quot;quickcopy&quot; is <code>true</code>, a shallow reference
copy of the attribute is created - this should only be done as long as the
original source IPP message will not be freed for the life of the
destination.<br>
<br>
The &quot;cb&quot; and &quot;cb_data&quot; parameters provide a generic way to &quot;filter&quot; the
attributes that are copied - the function must return <code>true</code> to copy the
attribute or <code>false</code> to skip it.  The function may also choose to do a
partial copy of the source attribute itself.</p>
<h3 class="function"><a id="ippCopyCredentialsString">ippCopyCredentialsString</a></h3>
<p class="description">Copy a credentials value from an IPP attribute.</p>
<p class="code">
<span class="reserved">char</span> *ippCopyCredentialsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Combined string or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function concatenates the 1setOf text credential values of an attribute,
separated by newlines.  The returned string must be freed using the <code>free</code>
function.</p>
<h3 class="function"><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
<p class="description">Create a CUPS array of attribute names from the
                              given requested-attributes attribute.</p>
<p class="code">
<a href="#cups_array_t">cups_array_t</a> *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS array or <code>NULL</code> if all</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
list of &quot;requested-attribute&quot; values supplied in an IPP request.  All IANA-
registered values are supported in addition to the CUPS IPP extension
attributes.<br>
<br>
The &quot;request&quot; parameter specifies the request message that was read from
the client.<br>
<br>
<code>NULL</code> is returned if all attributes should be returned.  Otherwise, the
result is a sorted array of attribute names, where
<code>cupsArrayFind(array, "attribute-name")</code> will return a non-NULL pointer.  The
array must be freed using <a href="#cupsArrayDelete"><code>cupsArrayDelete</code></a>.</p>
<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
<p class="description">Convert from RFC 2579 Date/Time format to time in
                    seconds.</p>
<p class="code">
time_t ippDateToTime(<span class="reserved">const</span> <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>date</th>
<td class="description">RFC 2579 date info</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">UNIX time value</p>
<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
<p class="description">Delete an IPP message.</p>
<p class="code">
<span class="reserved">void</span> ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h3 class="function"><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
<p class="description">Delete a single attribute in an IPP message.</p>
<p class="code">
<span class="reserved">void</span> ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute to delete</td></tr>
</tbody></table>
<h3 class="function"><a id="ippDeleteValues">ippDeleteValues</a></h3>
<p class="description">Delete values in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, size_t count);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>element</th>
<td class="description">Index of first value to delete (<code>0</code>-based)</td></tr>
<tr><th>count</th>
<td class="description">Number of values to delete</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function deletes one or more values in an attribute.  The &quot;element&quot;
parameter specifies the first value to delete, starting at <code>0</code>.  It must be
less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value,
which will set the variable to <code>NULL</code>.<br>
<br>
Deleting all values in an attribute deletes the attribute.</p>
<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
<p class="description">Return a string corresponding to the enum value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippEnumString(<span class="reserved">const</span> <span class="reserved">char</span> *attrname, <span class="reserved">int</span> enumvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attrname</th>
<td class="description">Attribute name</td></tr>
<tr><th>enumvalue</th>
<td class="description">Enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Enum string</p>
<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
<p class="description">Return the value associated with a given enum string.</p>
<p class="code">
<span class="reserved">int</span> ippEnumValue(<span class="reserved">const</span> <span class="reserved">char</span> *attrname, <span class="reserved">const</span> <span class="reserved">char</span> *enumstring);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attrname</th>
<td class="description">Attribute name</td></tr>
<tr><th>enumstring</th>
<td class="description">Enum string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Enum value or <code>-1</code> if unknown</p>
<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
<p class="description">Return a name for the given status code.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippErrorString(ipp_status_t error);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>error</th>
<td class="description">Error status</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Text string</p>
<h3 class="function"><a id="ippErrorValue">ippErrorValue</a></h3>
<p class="description">Return a status code for the given name.</p>
<p class="code">
ipp_status_t ippErrorValue(<span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h3 class="function"><a id="ippFileClose">ippFileClose</a></h3>
<p class="description">Close an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileClose(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function closes the current IPP data file.  The <code>ipp_file_t</code> object can
be reused for another file as needed.</p>
<h3 class="function"><a id="ippFileDelete">ippFileDelete</a></h3>
<p class="description">Close an IPP data file and free all memory.</p>
<p class="code">
<span class="reserved">bool</span> ippFileDelete(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function closes an IPP data file, if necessary, and frees all memory
associated with it.</p>
<h3 class="function"><a id="ippFileExpandVars">ippFileExpandVars</a></h3>
<p class="description">Expand IPP data file and environment variables in a string.</p>
<p class="code">
size_t ippFileExpandVars(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">char</span> *dst, <span class="reserved">const</span> <span class="reserved">char</span> *src, size_t dstsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>dst</th>
<td class="description">Destination buffer</td></tr>
<tr><th>src</th>
<td class="description">Source string</td></tr>
<tr><th>dstsize</th>
<td class="description">Size of destination buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Required size for expanded variables</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function expands IPP data file variables of the form &quot;$name&quot; and
environment variables of the form &quot;$ENV[name]&quot; in the source string to the
destination string.  The</p>
<h3 class="function"><a id="ippFileGetAttribute">ippFileGetAttribute</a></h3>
<p class="description">Get a single named attribute from an IPP data file.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFileGetAttribute(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *name, ipp_tag_t value_tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>name</th>
<td class="description">Attribute name</td></tr>
<tr><th>value_tag</th>
<td class="description">Value tag or <code>IPP_TAG_ZERO</code> for any</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Attribute or <code>NULL</code> if none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function finds the first occurence of a named attribute in the current
IPP attributes in the specified data file.  Unlike
<a href="#ippFileGetAttributes"><code>ippFileGetAttributes</code></a>, this function does not clear the attribute
state.</p>
<h3 class="function"><a id="ippFileGetAttributes">ippFileGetAttributes</a></h3>
<p class="description">Get the current set of attributes from an IPP data file.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippFileGetAttributes(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP attributes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function gets the current set of attributes from an IPP data file.</p>
<h3 class="function"><a id="ippFileGetFilename">ippFileGetFilename</a></h3>
<p class="description">Get the filename for an IPP data file.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippFileGetFilename(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Filename</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the filename associated with an IPP data file.</p>
<h3 class="function"><a id="ippFileGetLineNumber">ippFileGetLineNumber</a></h3>
<p class="description">Get the current line number in an IPP data file.</p>
<p class="code">
<span class="reserved">int</span> ippFileGetLineNumber(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Line number</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the current line number in an IPP data file.</p>
<h3 class="function"><a id="ippFileGetVar">ippFileGetVar</a></h3>
<p class="description">Get the value of an IPP data file variable.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippFileGetVar(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>name</th>
<td class="description">Variable name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Variable value or <code>NULL</code> if none.</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the value of an IPP data file variable.  <code>NULL</code> is
returned if the variable is not set.</p>
<h3 class="function"><a id="ippFileNew">ippFileNew</a></h3>
<p class="description">Create a new IPP data file object for reading or writing.</p>
<p class="code">
<a href="#ipp_file_t">ipp_file_t</a> *ippFileNew(<a href="#ipp_file_t">ipp_file_t</a> *parent, <a href="#ipp_fattr_cb_t">ipp_fattr_cb_t</a> attr_cb, <a href="#ipp_ferror_cb_t">ipp_ferror_cb_t</a> error_cb, <span class="reserved">void</span> *cb_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>parent</th>
<td class="description">Parent data file or <code>NULL</code> for none</td></tr>
<tr><th>attr_cb</th>
<td class="description">Attribute filtering callback, if any</td></tr>
<tr><th>error_cb</th>
<td class="description">Error reporting callback, if any</td></tr>
<tr><th>cb_data</th>
<td class="description">Callback data, if any</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP data file</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function opens an IPP data file for reading (mode=&quot;r&quot;) or writing
(mode=&quot;w&quot;).  If the &quot;parent&quot; argument is not <code>NULL</code>, all variables from the
parent data file are copied to the new file.</p>
<h3 class="function"><a id="ippFileOpen">ippFileOpen</a></h3>
<p class="description">Open an IPP data file for reading or writing.</p>
<p class="code">
<span class="reserved">bool</span> ippFileOpen(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *filename, <span class="reserved">const</span> <span class="reserved">char</span> *mode);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>filename</th>
<td class="description">Filename to open</td></tr>
<tr><th>mode</th>
<td class="description">Open mode - &quot;r&quot; to read and &quot;w&quot; to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function opens an IPP data file for reading (mode=&quot;r&quot;) or writing
(mode=&quot;w&quot;).  If the &quot;parent&quot; argument is not <code>NULL</code>, all variables from the
parent data file are copied to the new file.</p>
<h3 class="function"><a id="ippFileRead">ippFileRead</a></h3>
<p class="description">Read an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileRead(<a href="#ipp_file_t">ipp_file_t</a> *file, <a href="#ipp_ftoken_cb_t">ipp_ftoken_cb_t</a> token_cb, <span class="reserved">bool</span> with_groups);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>token_cb</th>
<td class="description">Token callback</td></tr>
<tr><th>with_groups</th>
<td class="description">Read attributes with GROUP directives</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h3 class="function"><a id="ippFileReadCollection">ippFileReadCollection</a></h3>
<p class="description">Read a collection from an IPP data file.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippFileReadCollection(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Collection value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function reads a collection value from an IPP data file.  Collection
values are surrounded by curly braces (&quot;{&quot; and &quot;}&quot;) and have &quot;MEMBER&quot;
directives to define member attributes in the collection.</p>
<h3 class="function"><a id="ippFileReadToken">ippFileReadToken</a></h3>
<p class="description">Read a token from an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileReadToken(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">char</span> *token, size_t tokensize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>token</th>
<td class="description">Token buffer</td></tr>
<tr><th>tokensize</th>
<td class="description">Size of token buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function reads a single token or value from an IPP data file, skipping
comments and whitespace as needed.</p>
<h3 class="function"><a id="ippFileRestorePosition">ippFileRestorePosition</a></h3>
<p class="description">Restore the previous position in an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileRestorePosition(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function restores the previous position in an IPP data file that is open
for reading.</p>
<h3 class="function"><a id="ippFileSavePosition">ippFileSavePosition</a></h3>
<p class="description">Save the current position in an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileSavePosition(<a href="#ipp_file_t">ipp_file_t</a> *file);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function saves the current position in an IPP data file that is open
for reading.</p>
<h3 class="function"><a id="ippFileSetAttributes">ippFileSetAttributes</a></h3>
<p class="description">Set the attributes for an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileSetAttributes(<a href="#ipp_file_t">ipp_file_t</a> *file, <a href="#ipp_t">ipp_t</a> *attrs);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>attrs</th>
<td class="description">IPP attributes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the current set of attributes for an IPP data file,
typically an empty collection created with <a href="#ippNew"><code>ippNew</code></a>.</p>
<h3 class="function"><a id="ippFileSetGroupTag">ippFileSetGroupTag</a></h3>
<p class="description">Set the group tag for an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileSetGroupTag(<a href="#ipp_file_t">ipp_file_t</a> *file, ipp_tag_t group_tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>group_tag</th>
<td class="description">Group tag</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets the group tag associated with attributes that are read
from an IPP data file.</p>
<h3 class="function"><a id="ippFileSetVar">ippFileSetVar</a></h3>
<p class="description">Set an IPP data file variable to a constant value.</p>
<p class="code">
<span class="reserved">bool</span> ippFileSetVar(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>name</th>
<td class="description">Variable name</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets an IPP data file variable to a constant value.  Setting
the &quot;uri&quot; variable also initializes the &quot;scheme&quot;, &quot;uriuser&quot;, &quot;hostname&quot;,
&quot;port&quot;, and &quot;resource&quot; variables.</p>
<h3 class="function"><a id="ippFileSetVarf">ippFileSetVarf</a></h3>
<p class="description">Set an IPP data file variable to a formatted value.</p>
<p class="code">
<span class="reserved">bool</span> ippFileSetVarf(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *value, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>name</th>
<td class="description">Variable name</td></tr>
<tr><th>value</th>
<td class="description">Printf-style value</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sets an IPP data file variable to a formatted value.  Setting
the &quot;uri&quot; variable also initializes the &quot;scheme&quot;, &quot;uriuser&quot;, &quot;hostname&quot;,
&quot;port&quot;, and &quot;resource&quot; variables.</p>
<h3 class="function"><a id="ippFileWriteAttributes">ippFileWriteAttributes</a></h3>
<p class="description">Write an IPP message to an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileWriteAttributes(<a href="#ipp_file_t">ipp_file_t</a> *file, <a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">bool</span> with_groups);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>ipp</th>
<td class="description">IPP attributes to write</td></tr>
<tr><th>with_groups</th>
<td class="description"><code>true</code> to include GROUPs, <code>false</code> otherwise</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function writes an IPP message to an IPP data file using the attribute
filter specified in the call to <a href="#ippFileOpen"><code>ippFileOpen</code></a>.  If &quot;with_group&quot; is
<code>true</code>, &quot;GROUP&quot; directives are written as necessary to place the attributes
in the correct groups.</p>
<h3 class="function"><a id="ippFileWriteComment">ippFileWriteComment</a></h3>
<p class="description">Write a comment to an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileWriteComment(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *comment, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>comment</th>
<td class="description">Printf-style comment string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function writes a comment to an IPP data file.  Every line in the string
is prefixed with the &quot;#&quot; character and indented as needed.</p>
<h3 class="function"><a id="ippFileWriteToken">ippFileWriteToken</a></h3>
<p class="description">Write a token or value string to an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileWriteToken(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *token);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>token</th>
<td class="description">Token/value string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function writes a token or value string to an IPP data file, quoting
and indenting the string as needed.</p>
<h3 class="function"><a id="ippFileWriteTokenf">ippFileWriteTokenf</a></h3>
<p class="description">Write a formatted token or value string to an IPP data file.</p>
<p class="code">
<span class="reserved">bool</span> ippFileWriteTokenf(<a href="#ipp_file_t">ipp_file_t</a> *file, <span class="reserved">const</span> <span class="reserved">char</span> *token, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>file</th>
<td class="description">IPP data file</td></tr>
<tr><th>token</th>
<td class="description">Printf-style token/value string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function writes a formatted token or value string to an IPP data file,
quoting and indenting the string as needed.</p>
<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
<p class="description">Find a named attribute in an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">const</span> <span class="reserved">char</span> *name, ipp_tag_t type);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>type</th>
<td class="description">Type of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function finds the first occurrence of a named attribute in an IPP
message.  The attribute name can contain a hierarchical list of attribute and
member names separated by slashes, for example &quot;media-col/media-size&quot;.</p>
<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
<p class="description">Find the next named attribute in an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">const</span> <span class="reserved">char</span> *name, ipp_tag_t type);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>type</th>
<td class="description">Type of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function finds the next named attribute in an IPP message.  The
attribute name can contain a hierarchical list of attribute and member names
separated by slashes, for example &quot;media-col/media-size&quot;.</p>
<h3 class="function"><a id="ippGetBoolean">ippGetBoolean</a></h3>
<p class="description">Get a boolean value for an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Boolean value or <code>false</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetCollection">ippGetCollection</a></h3>
<p class="description">Get a collection value for an attribute.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Collection value or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetCount">ippGetCount</a></h3>
<p class="description">Get the number of values in an attribute.</p>
<p class="code">
size_t ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of values or 0 on error</p>
<h3 class="function"><a id="ippGetDate">ippGetDate</a></h3>
<p class="description">Get a dateTime value for an attribute.</p>
<p class="code">
<span class="reserved">const</span> <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">dateTime value or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetFirstAttribute">ippGetFirstAttribute</a></h3>
<p class="description">Return the first attribute in the message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippGetFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">First attribute or <code>NULL</code> if none</p>
<h3 class="function"><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
<p class="description">Get the group associated with an attribute.</p>
<p class="code">
ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
<h3 class="function"><a id="ippGetInteger">ippGetInteger</a></h3>
<p class="description">Get the integer/enum value for an attribute.</p>
<p class="code">
<span class="reserved">int</span> ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value or <code>0</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetLength">ippGetLength</a></h3>
<p class="description">Compute the length of an IPP message.</p>
<p class="code">
size_t ippGetLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Size of IPP message</p>
<h3 class="function"><a id="ippGetName">ippGetName</a></h3>
<p class="description">Get the attribute name.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Attribute name or <code>NULL</code> for separators</p>
<h3 class="function"><a id="ippGetNextAttribute">ippGetNextAttribute</a></h3>
<p class="description">Return the next attribute in the message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippGetNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Next attribute or <code>NULL</code> if none</p>
<h3 class="function"><a id="ippGetOctetString">ippGetOctetString</a></h3>
<p class="description">Get an octetString value from an IPP attribute.</p>
<p class="code">
<span class="reserved">void</span> *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element, size_t *datalen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>datalen</th>
<td class="description">Length of octetString data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Pointer to octetString data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from '0' to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetOperation">ippGetOperation</a></h3>
<p class="description">Get the operation ID in an IPP message.</p>
<p class="code">
<a href="#ipp_op_t">ipp_op_t</a> ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Operation ID or 0 on error</p>
<h3 class="function"><a id="ippGetPort">ippGetPort</a></h3>
<p class="description">Return the default IPP port number.</p>
<p class="code">
<span class="reserved">int</span> ippGetPort(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Port number</p>
<h3 class="function"><a id="ippGetRange">ippGetRange</a></h3>
<p class="description">Get a rangeOfInteger value from an attribute.</p>
<p class="code">
<span class="reserved">int</span> ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element, <span class="reserved">int</span> *uppervalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>uppervalue</th>
<td class="description">Upper value of range</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Lower value of range or 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetRequestId">ippGetRequestId</a></h3>
<p class="description">Get the request ID from an IPP message.</p>
<p class="code">
<span class="reserved">int</span> ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Request ID or 0 on error</p>
<h3 class="function"><a id="ippGetResolution">ippGetResolution</a></h3>
<p class="description">Get a resolution value for an attribute.</p>
<p class="code">
<span class="reserved">int</span> ippGetResolution(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element, <span class="reserved">int</span> *yres, <a href="#ipp_res_t">ipp_res_t</a> *units);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>yres</th>
<td class="description">Vertical/feed resolution</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Horizontal/cross feed resolution or 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr)</code> - 1.</p>
<h3 class="function"><a id="ippGetState">ippGetState</a></h3>
<p class="description">Get the IPP message state.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP message state value</p>
<h3 class="function"><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
<p class="description">Get the status code from an IPP response or event message.</p>
<p class="code">
ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP response or event message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status code in IPP message</p>
<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
<p class="description"></p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, size_t element, <span class="reserved">const</span> <span class="reserved">char</span> **language);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Get the string and optionally the language code for an attribute.</p>
<p class="discussion">The &quot;element&quot; parameter specifies which value to get from <code>0</code> to
<code>ippGetCount(attr) - 1</code>.</p>
<h3 class="function"><a id="ippGetValueTag">ippGetValueTag</a></h3>
<p class="description">Get the value tag for an attribute.</p>
<p class="code">
ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
<h3 class="function"><a id="ippGetVersion">ippGetVersion</a></h3>
<p class="description">Get the major and minor version number from an IPP message.</p>
<p class="code">
<span class="reserved">int</span> ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">int</span> *minor);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>minor</th>
<td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Major version number or 0 on error</p>
<h3 class="function"><a id="ippNew">ippNew</a></h3>
<p class="description">Allocate a new IPP message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNew(<span class="reserved">void</span>);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New IPP message</p>
<h3 class="function"><a id="ippNewRequest">ippNewRequest</a></h3>
<p class="description">Allocate a new IPP request message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNewRequest(<a href="#ipp_op_t">ipp_op_t</a> op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>op</th>
<td class="description">Operation code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP request message</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The new request message is initialized with the &quot;attributes-charset&quot; and
&quot;attributes-natural-language&quot; attributes added. The
&quot;attributes-natural-language&quot; value is derived from the current locale.</p>
<h3 class="function"><a id="ippNewResponse">ippNewResponse</a></h3>
<p class="description">Allocate a new IPP response message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>request</th>
<td class="description">IPP request message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP response message</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The new response message is initialized with the same &quot;version-number&quot;,
&quot;request-id&quot;, &quot;attributes-charset&quot;, and &quot;attributes-natural-language&quot; as the
provided request message.  If the &quot;attributes-charset&quot; or
&quot;attributes-natural-language&quot; attributes are missing from the request,
'utf-8' and a value derived from the current locale are substituted,
respectively.</p>
<h3 class="function"><a id="ippOpString">ippOpString</a></h3>
<p class="description">Return a name for the given operation id.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippOpString(<a href="#ipp_op_t">ipp_op_t</a> op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>op</th>
<td class="description">Operation ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Name</p>
<h3 class="function"><a id="ippOpValue">ippOpValue</a></h3>
<p class="description">Return an operation id for the given name.</p>
<p class="code">
<a href="#ipp_op_t">ipp_op_t</a> ippOpValue(<span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Textual name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Operation ID</p>
<h3 class="function"><a id="ippRead">ippRead</a></h3>
<p class="description">Read data for an IPP message from a HTTP connection.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippRead(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="ippReadFile">ippReadFile</a></h3>
<p class="description">Read data for an IPP message from a file.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(<span class="reserved">int</span> fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">HTTP data</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="ippReadIO">ippReadIO</a></h3>
<p class="description">Read data for an IPP message.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippReadIO(<span class="reserved">void</span> *src, <a href="#ipp_io_cb_t">ipp_io_cb_t</a> cb, <span class="reserved">bool</span> blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>src</th>
<td class="description">Data source</td></tr>
<tr><th>cb</th>
<td class="description">Read callback function</td></tr>
<tr><th>blocking</th>
<td class="description">Use blocking IO?</td></tr>
<tr><th>parent</th>
<td class="description">Parent request, if any</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="ippRestore">ippRestore</a></h3>
<p class="description">Restore a previously saved find position.</p>
<p class="code">
<span class="reserved">void</span> ippRestore(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h3 class="function"><a id="ippSave">ippSave</a></h3>
<p class="description">Save the current find position.</p>
<p class="code">
<span class="reserved">void</span> ippSave(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h3 class="function"><a id="ippSetBoolean">ippSetBoolean</a></h3>
<p class="description">Set a boolean value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">bool</span> boolvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>boolvalue</th>
<td class="description">Boolean value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetCollection">ippSetCollection</a></h3>
<p class="description">Set a collection value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetCollection(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <a href="#ipp_t">ipp_t</a> *colvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>colvalue</th>
<td class="description">Collection value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetDate">ippSetDate</a></h3>
<p class="description">Set a dateTime value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetDate(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">const</span> <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>datevalue</th>
<td class="description">dateTime value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
<p class="description">Set the group tag of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetGroupTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t group_tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>group_tag</th>
<td class="description">Group tag</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;group&quot; parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippSetInteger">ippSetInteger</a></h3>
<p class="description">Set an integer or enum value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">int</span> intvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>intvalue</th>
<td class="description">Integer/enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetName">ippSetName</a></h3>
<p class="description">Set the name of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>name</th>
<td class="description">Attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.</p>
<h3 class="function"><a id="ippSetOctetString">ippSetOctetString</a></h3>
<p class="description">Set an octetString value in an IPP attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetOctetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">const</span> <span class="reserved">void</span> *data, size_t datalen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>data</th>
<td class="description">Pointer to octetString data</td></tr>
<tr><th>datalen</th>
<td class="description">Length of octetString data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetOperation">ippSetOperation</a></h3>
<p class="description">Set the operation ID in an IPP request message.</p>
<p class="code">
<span class="reserved">bool</span> ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_op_t">ipp_op_t</a> op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request message</td></tr>
<tr><th>op</th>
<td class="description">Operation ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
<p class="description">Set the default port number.</p>
<p class="code">
<span class="reserved">void</span> ippSetPort(<span class="reserved">int</span> p);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>p</th>
<td class="description">Port number to use</td></tr>
</tbody></table>
<h3 class="function"><a id="ippSetRange">ippSetRange</a></h3>
<p class="description">Set a rangeOfInteger value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetRange(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">int</span> lowervalue, <span class="reserved">int</span> uppervalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>lowervalue</th>
<td class="description">Lower bound for range</td></tr>
<tr><th>uppervalue</th>
<td class="description">Upper bound for range</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetRequestId">ippSetRequestId</a></h3>
<p class="description">Set the request ID in an IPP message.</p>
<p class="code">
<span class="reserved">bool</span> ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">int</span> request_id);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>request_id</th>
<td class="description">Request ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;request_id&quot; parameter must be greater than 0.</p>
<h3 class="function"><a id="ippSetResolution">ippSetResolution</a></h3>
<p class="description">Set a resolution value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetResolution(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <a href="#ipp_res_t">ipp_res_t</a> unitsvalue, <span class="reserved">int</span> xresvalue, <span class="reserved">int</span> yresvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>unitsvalue</th>
<td class="description">Resolution units</td></tr>
<tr><th>xresvalue</th>
<td class="description">Horizontal/cross feed resolution</td></tr>
<tr><th>yresvalue</th>
<td class="description">Vertical/feed resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetState">ippSetState</a></h3>
<p class="description">Set the current state of the IPP message.</p>
<p class="code">
<span class="reserved">bool</span> ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>state</th>
<td class="description">IPP state value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h3 class="function"><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
<p class="description">Set the status code in an IPP response or event message.</p>
<p class="code">
<span class="reserved">bool</span> ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP response or event message</td></tr>
<tr><th>status</th>
<td class="description">Status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
<h3 class="function"><a id="ippSetString">ippSetString</a></h3>
<p class="description">Set a string value in an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">const</span> <span class="reserved">char</span> *strvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>strvalue</th>
<td class="description">String value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.</p>
<h3 class="function"><a id="ippSetStringf">ippSetStringf</a></h3>
<p class="description">Set a formatted string value of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetStringf(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.<br>
<br>
The &quot;format&quot; parameter uses formatting characters compatible with the
printf family of standard functions.  Additional arguments follow it as
needed.  The formatted string is truncated as needed to the maximum length of
the corresponding value type.</p>
<h3 class="function"><a id="ippSetStringfv">ippSetStringfv</a></h3>
<p class="description">Set a formatted string value of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetStringfv(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, size_t element, <span class="reserved">const</span> <span class="reserved">char</span> *format, va_list ap);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (<code>0</code>-based)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>ap</th>
<td class="description">Pointer to additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
The &quot;element&quot; parameter specifies which value to set from <code>0</code> to
<code>ippGetCount(attr)</code>.<br>
<br>
The &quot;format&quot; parameter uses formatting characters compatible with the
printf family of standard functions.  Additional arguments follow it as
needed.  The formatted string is truncated as needed to the maximum length of
the corresponding value type.</p>
<h3 class="function"><a id="ippSetValueTag">ippSetValueTag</a></h3>
<p class="description">Set the value tag of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippSetValueTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t value_tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>value_tag</th>
<td class="description">Value tag</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The &quot;attr&quot; parameter may be modified as a result of setting the value.<br>
<br>
Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
will be rejected.<br>
<br>
Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
code for the current locale.</p>
<h3 class="function"><a id="ippSetVersion">ippSetVersion</a></h3>
<p class="description">Set the version number in an IPP message.</p>
<p class="code">
<span class="reserved">bool</span> ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, <span class="reserved">int</span> major, <span class="reserved">int</span> minor);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>major</th>
<td class="description">Major version number (major.minor)</td></tr>
<tr><th>minor</th>
<td class="description">Minor version number (major.minor)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ipp&quot; parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or  <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.</p>
<h3 class="function"><a id="ippStateString">ippStateString</a></h3>
<p class="description">Return the name corresponding to a state value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>state</th>
<td class="description">State value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">State name</p>
<h3 class="function"><a id="ippTagString">ippTagString</a></h3>
<p class="description">Return the tag name corresponding to a tag value.</p>
<p class="code">
<span class="reserved">const</span> <span class="reserved">char</span> *ippTagString(ipp_tag_t tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>tag</th>
<td class="description">Tag value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Tag name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
/</p>
<h3 class="function"><a id="ippTagValue">ippTagValue</a></h3>
<p class="description">Return the tag value corresponding to a tag name.</p>
<p class="code">
ipp_tag_t ippTagValue(<span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Tag name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Tag value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.</p>
<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
<p class="description">Convert from time in seconds to RFC 2579 format.</p>
<p class="code">
<span class="reserved">const</span> <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>t</th>
<td class="description">Time in seconds</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">RFC-2579 date/time data</p>
<h3 class="function"><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
<p class="description">Validate the contents of an attribute.</p>
<p class="code">
<span class="reserved">bool</span> ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if valid, <code>false</code> otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function validates the contents of an attribute based on the name and
value tag.  <code>true</code> is returned if the attribute is valid, <code>false</code> otherwise.
On failure, <a href="#cupsGetErrorString"><code>cupsGetErrorString</code></a> is set to a human-readable message.</p>
<h3 class="function"><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
<p class="description">Validate all attributes in an IPP message.</p>
<p class="code">
<span class="reserved">bool</span> ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> if valid, <code>false</code> otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function validates the contents of the IPP message, including each
attribute.  Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsGetErrorString"><code>cupsGetErrorString</code></a> is
set to a human-readable message on failure.</p>
<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
<p class="description">Write data for an IPP message to a HTTP connection.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippWrite(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="ippWriteFile">ippWriteFile</a></h3>
<p class="description">Write data for an IPP message to a file.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(<span class="reserved">int</span> fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">HTTP data</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="ippWriteIO">ippWriteIO</a></h3>
<p class="description">Write data for an IPP message.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO(<span class="reserved">void</span> *dst, <a href="#ipp_io_cb_t">ipp_io_cb_t</a> cb, <span class="reserved">bool</span> blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination</td></tr>
<tr><th>cb</th>
<td class="description">Write callback function</td></tr>
<tr><th>blocking</th>
<td class="description">Use blocking IO?</td></tr>
<tr><th>parent</th>
<td class="description">Parent IPP message</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><a id="pwgFormatSizeName">pwgFormatSizeName</a></h3>
<p class="description">Generate a PWG self-describing media size name.</p>
<p class="code">
<span class="reserved">bool</span> pwgFormatSizeName(<span class="reserved">char</span> *keyword, size_t keysize, <span class="reserved">const</span> <span class="reserved">char</span> *prefix, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">int</span> width, <span class="reserved">int</span> length, <span class="reserved">const</span> <span class="reserved">char</span> *units);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>keyword</th>
<td class="description">Keyword buffer</td></tr>
<tr><th>keysize</th>
<td class="description">Size of keyword buffer</td></tr>
<tr><th>prefix</th>
<td class="description">Prefix for PWG size or <code>NULL</code> for automatic</td></tr>
<tr><th>name</th>
<td class="description">Size name or <code>NULL</code></td></tr>
<tr><th>width</th>
<td class="description">Width of page in 2540ths</td></tr>
<tr><th>length</th>
<td class="description">Length of page in 2540ths</td></tr>
<tr><th>units</th>
<td class="description">Units - &quot;in&quot;, &quot;mm&quot;, or <code>NULL</code> for automatic</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function generates a PWG self-describing media size name of the form
&quot;prefix_name_WIDTHxLENGTHunits&quot;.  The prefix is typically &quot;custom&quot; or &quot;roll&quot;
for user-supplied sizes but can also be &quot;disc&quot;, &quot;iso&quot;, &quot;jis&quot;, &quot;jpn&quot;, &quot;na&quot;,
&quot;oe&quot;, &quot;om&quot;, &quot;prc&quot;, or &quot;roc&quot;.  A value of <code>NULL</code> automatically chooses
&quot;oe&quot; or &quot;om&quot; depending on the units.<br>
<br>
The size name may only contain lowercase letters, numbers, &quot;-&quot;, and &quot;.&quot;.  If
<code>NULL</code> is passed, the size name will contain the formatted dimensions.<br>
<br>
The width and length are specified in hundredths of millimeters, equivalent
to 1/100000th of a meter or 1/2540th of an inch.  The width, length, and
units used for the generated size name are calculated automatically if the
units string is <code>NULL</code>, otherwise inches (&quot;in&quot;) or millimeters (&quot;mm&quot;)
are used.</p>
<h3 class="function"><a id="pwgInitSize">pwgInitSize</a></h3>
<p class="description">Initialize a pwg_size_t structure using IPP Job Template
                  attributes.</p>
<p class="code">
<span class="reserved">bool</span> pwgInitSize(<a href="#pwg_size_t">pwg_size_t</a> *size, <a href="#ipp_t">ipp_t</a> *job, <span class="reserved">bool</span> *margins_set);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>size</th>
<td class="description">Size to initialize</td></tr>
<tr><th>job</th>
<td class="description">Job template attributes</td></tr>
<tr><th>margins_set</th>
<td class="description"><code>true</code> if margins were set, <code>false</code> otherwise</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description"><code>true</code> on success, <code>false</code> on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function initializes a pwg_size_t structure from an IPP &quot;media&quot; or
&quot;media-col&quot; attribute in the specified IPP message.  0 is returned if neither
attribute is found in the message or the values are not valid.<br>
<br>
The &quot;margins_set&quot; variable is initialized to 1 if any &quot;media-xxx-margin&quot;
member attribute was specified in the &quot;media-col&quot; Job Template attribute,
otherwise it is initialized to 0.</p>
<h3 class="function"><a id="pwgMediaForLegacy">pwgMediaForLegacy</a></h3>
<p class="description">Find a PWG media size by ISO/IPP legacy name.</p>
<p class="code">
<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForLegacy(<span class="reserved">const</span> <span class="reserved">char</span> *legacy);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>legacy</th>
<td class="description">Legacy size name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching size or NULL</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;name&quot; argument specifies the legacy ISO media size name, for example
&quot;iso-a4&quot; or &quot;na-letter&quot;.</p>
<h3 class="function"><a id="pwgMediaForPPD">pwgMediaForPPD</a></h3>
<p class="description">Find a PWG media size by Adobe PPD name.</p>
<p class="code">
<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPPD(<span class="reserved">const</span> <span class="reserved">char</span> *ppd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ppd</th>
<td class="description">PPD size name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching size or NULL</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;ppd&quot; argument specifies an Adobe page size name as defined in Table B.1
of the Adobe PostScript Printer Description File Format Specification Version
4.3.<br>
<br>
If the name is non-standard, the returned PWG media size is stored in
thread-local storage and is overwritten by each call to the function in the
thread.  Custom names can be of the form &quot;Custom.WIDTHxLENGTH[units]&quot; or
&quot;WIDTHxLENGTH[units]&quot;.</p>
<h3 class="function"><a id="pwgMediaForPWG">pwgMediaForPWG</a></h3>
<p class="description">Find a PWG media size by 5101.1 self-describing name.</p>
<p class="code">
<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPWG(<span class="reserved">const</span> <span class="reserved">char</span> *pwg);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>pwg</th>
<td class="description">PWG size name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching size or NULL</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;pwg&quot; argument specifies a self-describing media size name of the form
&quot;prefix_name_WIDTHxLENGTHunits&quot; as defined in PWG 5101.1.<br>
<br>
If the name is non-standard, the returned PWG media size is stored in
thread-local storage and is overwritten by each call to the function in the
thread.</p>
<h3 class="function"><a id="pwgMediaForSize">pwgMediaForSize</a></h3>
<p class="description">Get the PWG media size for the given dimensions.</p>
<p class="code">
<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForSize(<span class="reserved">int</span> width, <span class="reserved">int</span> length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>width</th>
<td class="description">Width in hundredths of millimeters</td></tr>
<tr><th>length</th>
<td class="description">Length in hundredths of millimeters</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">PWG media name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;width&quot; and &quot;length&quot; are in hundredths of millimeters, equivalent to
1/100000th of a meter or 1/2540th of an inch.<br>
<br>
If the dimensions are non-standard, the returned PWG media size is stored in
thread-local storage and is overwritten by each call to the function in the
thread.</p>
<h2 class="title"><a id="TYPES">Data Types</a></h2>
<h3 class="typedef"><a id="cups_acopy_cb_t">cups_acopy_cb_t</a></h3>
<p class="description">Array element copy function</p>
<p class="code">
typedef void *(*)(void *element, void *data)cups_acopy_cb_t;
</p>
<h3 class="typedef"><a id="cups_adv_t">cups_adv_t</a></h3>
<p class="description">AdvanceMedia attribute values</p>
<p class="code">
typedef enum <a href="#cups_adv_e">cups_adv_e</a> cups_adv_t;
</p>
<h3 class="typedef"><a id="cups_afree_cb_t">cups_afree_cb_t</a></h3>
<p class="description">Array element free function</p>
<p class="code">
typedef void(*)(void *element, void *data)cups_afree_cb_t;
</p>
<h3 class="typedef"><a id="cups_ahash_cb_t">cups_ahash_cb_t</a></h3>
<p class="description">Array hash function</p>
<p class="code">
typedef size_t(*)(void *element, void *data)cups_ahash_cb_t;
</p>
<h3 class="typedef"><a id="cups_array_cb_t">cups_array_cb_t</a></h3>
<p class="description">Array comparison function</p>
<p class="code">
typedef int(*)(void *first, void *second, void *data)cups_array_cb_t;
</p>
<h3 class="typedef"><a id="cups_array_t">cups_array_t</a></h3>
<p class="description">CUPS array type</p>
<p class="code">
typedef struct _cups_array_s cups_array_t;
</p>
<h3 class="typedef"><a id="cups_bool_t">cups_bool_t</a></h3>
<p class="description">Boolean type</p>
<p class="code">
typedef enum <a href="#cups_bool_e">cups_bool_e</a> cups_bool_t;
</p>
<h3 class="typedef"><a id="cups_cert_san_cb_t">cups_cert_san_cb_t</a></h3>
<p class="description">Certificate signing subjectAltName callback</p>
<p class="code">
typedef bool(*)(const char *common_name, const char *subject_alt_name, void *user_data)cups_cert_san_cb_t;
</p>
<h3 class="typedef"><a id="cups_cond_t">cups_cond_t</a></h3>
<p class="description">Condition variable</p>
<p class="code">
typedef pthread_cond_t cups_cond_t;
</p>
<h3 class="typedef"><a id="cups_credpurpose_t">cups_credpurpose_t</a></h3>
<p class="description">Combined X.509 credential purposes for <a href="#cupsCreateCredentials"><code>cupsCreateCredentials</code></a> and <a href="#cupsCreateCredentialsRequest"><code>cupsCreateCredentialsRequest</code></a></p>
<p class="code">
typedef unsigned cups_credpurpose_t;
</p>
<h3 class="typedef"><a id="cups_credtype_t">cups_credtype_t</a></h3>
<p class="description">X.509 credential types for <a href="#cupsCreateCredentials"><code>cupsCreateCredentials</code></a> and <a href="#cupsCreateCredentialsRequest"><code>cupsCreateCredentialsRequest</code></a></p>
<p class="code">
typedef enum <a href="#cups_credtype_e">cups_credtype_e</a> cups_credtype_t;
</p>
<h3 class="typedef"><a id="cups_credusage_t">cups_credusage_t</a></h3>
<p class="description">Combined X.509 keyUsage flags for <a href="#cupsCreateCredentials"><code>cupsCreateCredentials</code></a> and <a href="#cupsCreateCredentialsRequest"><code>cupsCreateCredentialsRequest</code></a></p>
<p class="code">
typedef unsigned cups_credusage_t;
</p>
<h3 class="typedef"><a id="cups_cspace_t">cups_cspace_t</a></h3>
<p class="description">cupsColorSpace attribute values</p>
<p class="code">
typedef enum <a href="#cups_cspace_e">cups_cspace_e</a> cups_cspace_t;
</p>
<h3 class="typedef"><a id="cups_cut_t">cups_cut_t</a></h3>
<p class="description">CutMedia attribute values</p>
<p class="code">
typedef enum <a href="#cups_cut_e">cups_cut_e</a> cups_cut_t;
</p>
<h3 class="typedef"><a id="cups_dentry_t">cups_dentry_t</a></h3>
<p class="description">Directory entry type</p>
<p class="code">
typedef struct <a href="#cups_dentry_s">cups_dentry_s</a> cups_dentry_t;
</p>
<h3 class="typedef"><a id="cups_dest_cb_t">cups_dest_cb_t</a></h3>
<p class="description">Destination enumeration callback</p>
<p class="code">
typedef bool(*)(void *user_data, <a href="#cups_dest_flags_t">cups_dest_flags_t</a> flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
</p>
<h3 class="typedef"><a id="cups_dest_flags_t">cups_dest_flags_t</a></h3>
<p class="description">Combined flags for <a href="#cupsConnectDest"><code>cupsConnectDest</code></a> and <a href="#cupsEnumDests"><code>cupsEnumDests</code></a></p>
<p class="code">
typedef unsigned cups_dest_flags_t;
</p>
<h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
<p class="description">Destination</p>
<p class="code">
typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
</p>
<h3 class="typedef"><a id="cups_dinfo_t">cups_dinfo_t</a></h3>
<p class="description">Destination capability and status information</p>
<p class="code">
typedef struct _cups_dinfo_s cups_dinfo_t;
</p>
<h3 class="typedef"><a id="cups_dir_t">cups_dir_t</a></h3>
<p class="description">Directory type</p>
<p class="code">
typedef struct _cups_dir_s cups_dir_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_browse_cb_t">cups_dnssd_browse_cb_t</a></h3>
<p class="description">DNS-SD browse callback</p>
<p class="code">
typedef void(*)(cups_dnssd_browse_t *browse, void *cb_data, <a href="#cups_dnssd_flags_t">cups_dnssd_flags_t</a> flags, uint32_t if_index, const char *name, const char *regtype, const char *domain)cups_dnssd_browse_cb_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_error_cb_t">cups_dnssd_error_cb_t</a></h3>
<p class="description">DNS-SD error callback</p>
<p class="code">
typedef void(*)(void *cb_data, const char *message)cups_dnssd_error_cb_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_flags_t">cups_dnssd_flags_t</a></h3>
<p class="description">DNS-SD callback flag bitmask</p>
<p class="code">
typedef unsigned cups_dnssd_flags_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_query_cb_t">cups_dnssd_query_cb_t</a></h3>
<p class="description">DNS-SD query callback</p>
<p class="code">
typedef void(*)(cups_dnssd_query_t *query, void *cb_data, <a href="#cups_dnssd_flags_t">cups_dnssd_flags_t</a> flags, uint32_t if_index, const char *fullname, uint16_t rrtype, const void *qdata, uint16_t qlen) cups_dnssd_query_cb_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_query_t">cups_dnssd_query_t</a></h3>
<p class="description">DNS query request</p>
<p class="code">
typedef struct _cups_dnssd_query_s cups_dnssd_query_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_resolve_cb_t">cups_dnssd_resolve_cb_t</a></h3>
<p class="description">DNS-SD resolve callback</p>
<p class="code">
typedef void(*)(cups_dnssd_resolve_t *res, void *cb_data, <a href="#cups_dnssd_flags_t">cups_dnssd_flags_t</a> flags, uint32_t if_index, const char *fullname, const char *host, uint16_t port, size_t num_txt, <a href="#cups_option_t">cups_option_t</a> *txt)cups_dnssd_resolve_cb_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_resolve_t">cups_dnssd_resolve_t</a></h3>
<p class="description">DNS resolve request</p>
<p class="code">
typedef struct _cups_dnssd_resolve_s cups_dnssd_resolve_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_browse_t">cups_dnssd_browse_t</a></h3>
<p class="description">DNS record type values</p>
<p class="code">
typedef typedef struct _cups_dnssd_browse_s cups_dnssd_browse_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_service_cb_t">cups_dnssd_service_cb_t</a></h3>
<p class="description">DNS-SD service registration callback</p>
<p class="code">
typedef void(*)(cups_dnssd_service_t *service, void *cb_data, <a href="#cups_dnssd_flags_t">cups_dnssd_flags_t</a> flags) cups_dnssd_service_cb_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_service_t">cups_dnssd_service_t</a></h3>
<p class="description">DNS service registration</p>
<p class="code">
typedef struct _cups_dnssd_service_s cups_dnssd_service_t;
</p>
<h3 class="typedef"><a id="cups_dnssd_t">cups_dnssd_t</a></h3>
<p class="description">DNS-SD context</p>
<p class="code">
typedef struct _cups_dnssd_s cups_dnssd_t;
</p>
<h3 class="typedef"><a id="cups_edge_t">cups_edge_t</a></h3>
<p class="description">LeadingEdge attribute values</p>
<p class="code">
typedef enum <a href="#cups_edge_e">cups_edge_e</a> cups_edge_t;
</p>
<h3 class="typedef"><a id="cups_utf32_t">cups_utf32_t</a></h3>
<p class="description">Language Encodings</p>
<p class="code">
typedef typedef unsigned long cups_utf32_t;
</p>
<h3 class="typedef"><a id="cups_file_t">cups_file_t</a></h3>
<p class="description">CUPS file type</p>
<p class="code">
typedef struct _cups_file_s cups_file_t;
</p>
<h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
<p class="description">Job information</p>
<p class="code">
typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
</p>
<h3 class="typedef"><a id="cups_jog_t">cups_jog_t</a></h3>
<p class="description">Jog attribute values</p>
<p class="code">
typedef enum <a href="#cups_jog_e">cups_jog_e</a> cups_jog_t;
</p>
<h3 class="typedef"><a id="cups_json_t">cups_json_t</a></h3>
<p class="description">JSON node</p>
<p class="code">
typedef struct _cups_json_s cups_json_t;
</p>
<h3 class="typedef"><a id="cups_jtype_t">cups_jtype_t</a></h3>
<p class="description">JSON node type</p>
<p class="code">
typedef enum <a href="#cups_jtype_e">cups_jtype_e</a> cups_jtype_t;
</p>
<h3 class="typedef"><a id="cups_jwa_t">cups_jwa_t</a></h3>
<p class="description">JSON Web Algorithms</p>
<p class="code">
typedef enum <a href="#cups_jwa_e">cups_jwa_e</a> cups_jwa_t;
</p>
<h3 class="typedef"><a id="cups_jws_format_t">cups_jws_format_t</a></h3>
<p class="description">JSON Web Signature Formats</p>
<p class="code">
typedef enum <a href="#cups_jws_format_e">cups_jws_format_e</a> cups_jws_format_t;
</p>
<h3 class="typedef"><a id="cups_jwt_t">cups_jwt_t</a></h3>
<p class="description">JSON Web Token</p>
<p class="code">
typedef struct _cups_jwt_s cups_jwt_t;
</p>
<h3 class="typedef"><a id="cups_lang_t">cups_lang_t</a></h3>
<p class="description">Language Cache</p>
<p class="code">
typedef struct _cups_lang_s cups_lang_t;
</p>
<h3 class="typedef"><a id="cups_media_flags_t">cups_media_flags_t</a></h3>
<p class="description">Combined flags for <a href="#cupsGetDestMediaByName"><code>cupsGetDestMediaByName</code></a> and <a href="#cupsGetDestMediaBySize"><code>cupsGetDestMediaBySize</code></a></p>
<p class="code">
typedef unsigned cups_media_flags_t;
</p>
<h3 class="typedef"><a id="cups_media_t">cups_media_t</a></h3>
<p class="description">Media information</p>
<p class="code">
typedef struct <a href="#cups_media_s">cups_media_s</a> cups_media_t;
</p>
<h3 class="typedef"><a id="cups_mediapos_t">cups_mediapos_t</a></h3>
<p class="description">MediaPosition values</p>
<p class="code">
typedef enum <a href="#cups_mediapos_e">cups_mediapos_e</a> cups_mediapos_t;
</p>
<h3 class="typedef"><a id="cups_mutex_t">cups_mutex_t</a></h3>
<p class="description">Mutual exclusion lock</p>
<p class="code">
typedef pthread_mutex_t cups_mutex_t;
</p>
<h3 class="typedef"><a id="cups_oauth_cb_t">cups_oauth_cb_t</a></h3>
<p class="description">OAuth callback</p>
<p class="code">
typedef const char *(*)(http_t *http, const char *realm, const char *scope, const char *resource, void *user_data)cups_oauth_cb_t;
</p>
<h3 class="typedef"><a id="cups_ogrant_t">cups_ogrant_t</a></h3>
<p class="description">OAuth Grant Types</p>
<p class="code">
typedef enum <a href="#cups_ogrant_e">cups_ogrant_e</a> cups_ogrant_t;
</p>
<h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
<p class="description">Printer Options</p>
<p class="code">
typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
</p>
<h3 class="typedef"><a id="cups_order_t">cups_order_t</a></h3>
<p class="description">cupsColorOrder attribute values</p>
<p class="code">
typedef enum <a href="#cups_order_e">cups_order_e</a> cups_order_t;
</p>
<h3 class="typedef"><a id="cups_orient_t">cups_orient_t</a></h3>
<p class="description">Orientation attribute values</p>
<p class="code">
typedef enum <a href="#cups_orient_e">cups_orient_e</a> cups_orient_t;
</p>
<h3 class="typedef"><a id="cups_page_header_t">cups_page_header_t</a></h3>
<p class="description">Version 2 page header</p>
<p class="code">
typedef struct <a href="#cups_page_header_s">cups_page_header_s</a> cups_page_header_t;
</p>
<h3 class="typedef"><a id="cups_password_cb_t">cups_password_cb_t</a></h3>
<p class="description">New password callback</p>
<p class="code">
typedef const char *(*)(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource, void *user_data)cups_password_cb_t;
</p>
<h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
<p class="description">Combined printer type/capability flags</p>
<p class="code">
typedef unsigned cups_ptype_t;
</p>
<h3 class="typedef"><a id="cups_raster_mode_t">cups_raster_mode_t</a></h3>
<p class="description">cupsRasterOpen modes</p>
<p class="code">
typedef enum <a href="#cups_raster_mode_e">cups_raster_mode_e</a> cups_raster_mode_t;
</p>
<h3 class="typedef"><a id="cups_raster_t">cups_raster_t</a></h3>
<p class="description">Raster stream data</p>
<p class="code">
typedef struct _cups_raster_s cups_raster_t;
</p>
<h3 class="typedef"><a id="cups_rwlock_t">cups_rwlock_t</a></h3>
<p class="description">Reader/writer lock</p>
<p class="code">
typedef pthread_rwlock_t cups_rwlock_t;
</p>
<h3 class="typedef"><a id="cups_thread_func_t">cups_thread_func_t</a></h3>
<p class="description">Thread function</p>
<p class="code">
typedef void *(*)(void *arg)cups_thread_func_t;
</p>
<h3 class="typedef"><a id="cups_thread_key_t">cups_thread_key_t</a></h3>
<p class="description">Thread data key</p>
<p class="code">
typedef pthread_key_t cups_thread_key_t;
</p>
<h3 class="typedef"><a id="cups_thread_t">cups_thread_t</a></h3>
<p class="description">Thread identifier</p>
<p class="code">
typedef pthread_t cups_thread_t;
</p>
<h3 class="typedef"><a id="cups_whichjobs_t">cups_whichjobs_t</a></h3>
<p class="description">Which jobs for <a href="#cupsGetJobs"><code>cupsGetJobs</code></a></p>
<p class="code">
typedef enum <a href="#cups_whichjobs_e">cups_whichjobs_e</a> cups_whichjobs_t;
</p>
<h3 class="typedef"><a id="http_addr_t">http_addr_t</a></h3>
<p class="description">Socket address union</p>
<p class="code">
typedef union _http_addr_u http_addr_t;
</p>
<h3 class="typedef"><a id="http_addrlist_t">http_addrlist_t</a></h3>
<p class="description">Socket address list, which is used to enumerate all of the addresses that are associated with a hostname.</p>
<p class="code">
typedef struct <a href="#http_addrlist_s">http_addrlist_s</a> http_addrlist_t;
</p>
<h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
<p class="description">HTTP transfer encoding values</p>
<p class="code">
typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
</p>
<h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
<p class="description">HTTP encryption values</p>
<p class="code">
typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
</p>
<h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
<p class="description">HTTP field names</p>
<p class="code">
typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
</p>
<h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
<p class="description">HTTP keep-alive values</p>
<p class="code">
typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
</p>
<h3 class="typedef"><a id="http_resolve_cb_t">http_resolve_cb_t</a></h3>
<p class="description"><a href="#httpResolveURI"><code>httpResolveURI</code></a> callback</p>
<p class="code">
typedef bool(*)(void *data)http_resolve_cb_t;
</p>
<h3 class="typedef"><a id="http_resolve_t">http_resolve_t</a></h3>
<p class="description"><a href="#httpResolveURI"><code>httpResolveURI</code></a> options bitfield</p>
<p class="code">
typedef unsigned http_resolve_t;
</p>
<h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
<p class="description">HTTP state values; states are server-oriented...</p>
<p class="code">
typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
</p>
<h3 class="typedef"><a id="http_status_t">http_status_t</a></h3>
<p class="description">HTTP status codes</p>
<p class="code">
typedef enum <a href="#http_status_e">http_status_e</a> http_status_t;
</p>
<h3 class="typedef"><a id="http_t">http_t</a></h3>
<p class="description">HTTP connection type</p>
<p class="code">
typedef struct _http_s http_t;
</p>
<h3 class="typedef"><a id="http_timeout_cb_t">http_timeout_cb_t</a></h3>
<p class="description">HTTP timeout callback</p>
<p class="code">
typedef bool(*)(http_t *http, void *user_data)http_timeout_cb_t;
</p>
<h3 class="typedef"><a id="http_trust_t">http_trust_t</a></h3>
<p class="description">Level of trust for credentials</p>
<p class="code">
typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
</p>
<h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
<p class="description">URI en/decode flags</p>
<p class="code">
typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
</p>
<h3 class="typedef"><a id="http_uri_status_t">http_uri_status_t</a></h3>
<p class="description">URI separation status</p>
<p class="code">
typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
</p>
<h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
<p class="description">IPP attribute</p>
<p class="code">
typedef struct _ipp_attribute_s ipp_attribute_t;
</p>
<h3 class="typedef"><a id="ipp_copy_cb_t">ipp_copy_cb_t</a></h3>
<p class="description">ippCopyAttributes callback function</p>
<p class="code">
typedef bool(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copy_cb_t;
</p>
<h3 class="typedef"><a id="ipp_dstate_t">ipp_dstate_t</a></h3>
<p class="description">&quot;document-state&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_dstate_e">ipp_dstate_e</a> ipp_dstate_t;
</p>
<h3 class="typedef"><a id="ipp_fattr_cb_t">ipp_fattr_cb_t</a></h3>
<p class="description">IPP data file attribute callback</p>
<p class="code">
typedef bool(*)(ipp_file_t *file, void *cb_data, const char *name)ipp_fattr_cb_t;
</p>
<h3 class="typedef"><a id="ipp_ferror_cb_t">ipp_ferror_cb_t</a></h3>
<p class="description">IPP data file error callback</p>
<p class="code">
typedef bool(*)(ipp_file_t *file, void *cb_data, const char *error)ipp_ferror_cb_t;
</p>
<h3 class="typedef"><a id="ipp_file_t">ipp_file_t</a></h3>
<p class="description">IPP data file</p>
<p class="code">
typedef struct _ipp_file_s ipp_file_t;
</p>
<h3 class="typedef"><a id="ipp_ftoken_cb_t">ipp_ftoken_cb_t</a></h3>
<p class="description">IPP data file token callback</p>
<p class="code">
typedef bool(*)(ipp_file_t *file, void *cb_data, const char *token)ipp_ftoken_cb_t;
</p>
<h3 class="typedef"><a id="ipp_io_cb_t">ipp_io_cb_t</a></h3>
<p class="description">ippReadIO/ippWriteIO callback function</p>
<p class="code">
typedef ssize_t(*)(void *context, <a href="#ipp_uchar_t">ipp_uchar_t</a> *buffer, size_t bytes) ipp_io_cb_t;
</p>
<h3 class="typedef"><a id="ipp_jstate_t">ipp_jstate_t</a></h3>
<p class="description">&quot;job-state&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_jstate_e">ipp_jstate_e</a> ipp_jstate_t;
</p>
<h3 class="typedef"><a id="ipp_op_t">ipp_op_t</a></h3>
<p class="description">IPP operations</p>
<p class="code">
typedef enum <a href="#ipp_op_e">ipp_op_e</a> ipp_op_t;
</p>
<h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
<p class="description">&quot;orientation-requested&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
</p>
<h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
<p class="description">&quot;printer-state&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
</p>
<h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
<p class="description">&quot;print-quality&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
</p>
<h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
<p class="description">Resolution units</p>
<p class="code">
typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
</p>
<h3 class="typedef"><a id="ipp_rstate_t">ipp_rstate_t</a></h3>
<p class="description">&quot;resource-state&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_rstate_e">ipp_rstate_e</a> ipp_rstate_t;
</p>
<h3 class="typedef"><a id="ipp_sstate_t">ipp_sstate_t</a></h3>
<p class="description">&quot;system-state&quot; values</p>
<p class="code">
typedef enum <a href="#ipp_sstate_e">ipp_sstate_e</a> ipp_sstate_t;
</p>
<h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
<p class="description"><code>ipp_t</code> state values</p>
<p class="code">
typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
</p>
<h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
<p class="description">IPP request/response data</p>
<p class="code">
typedef struct _ipp_s ipp_t;
</p>
<h3 class="typedef"><a id="ipp_uchar_t">ipp_uchar_t</a></h3>
<p class="description">Unsigned 8-bit integer/character</p>
<p class="code">
typedef unsigned char ipp_uchar_t;
</p>
<h3 class="typedef"><a id="pwg_media_t">pwg_media_t</a></h3>
<p class="description">Common media size data</p>
<p class="code">
typedef struct <a href="#pwg_media_s">pwg_media_s</a> pwg_media_t;
</p>
<h2 class="title"><a id="STRUCTURES">Structures</a></h2>
<h3 class="struct"><a id="cups_dentry_s">cups_dentry_s</a></h3>
<p class="description">Directory entry type</p>
<p class="code"><span class="reserved">struct</span> cups_dentry_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">struct</span> stat fileinfo;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> filename[260];<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>fileinfo </th>
<td class="description">File information</td></tr>
<tr><th>filename[260] </th>
<td class="description">File name</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
<p class="description">Destination</p>
<p class="code"><span class="reserved">struct</span> cups_dest_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *name, *instance;<br>
&#160;&#160;&#160;&#160;<span class="reserved">bool</span> is_default;<br>
&#160;&#160;&#160;&#160;size_t num_options;<br>
&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>instance </th>
<td class="description">Local instance name or <code>NULL</code></td></tr>
<tr><th>is_default </th>
<td class="description">Is this printer the default?</td></tr>
<tr><th>num_options </th>
<td class="description">Number of options</td></tr>
<tr><th>options </th>
<td class="description">Options</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
<p class="description">Job information</p>
<p class="code"><span class="reserved">struct</span> cups_job_s {<br>
&#160;&#160;&#160;&#160;time_t completed_time;<br>
&#160;&#160;&#160;&#160;time_t creation_time;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *dest;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *format;<br>
&#160;&#160;&#160;&#160;<span class="reserved">int</span> id;<br>
&#160;&#160;&#160;&#160;<span class="reserved">int</span> priority;<br>
&#160;&#160;&#160;&#160;time_t processing_time;<br>
&#160;&#160;&#160;&#160;<span class="reserved">int</span> size;<br>
&#160;&#160;&#160;&#160;<a href="#ipp_jstate_t">ipp_jstate_t</a> state;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *title;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *user;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>completed_time </th>
<td class="description">Time the job was completed</td></tr>
<tr><th>creation_time </th>
<td class="description">Time the job was created</td></tr>
<tr><th>dest </th>
<td class="description">Printer or class name</td></tr>
<tr><th>format </th>
<td class="description">Document format</td></tr>
<tr><th>id </th>
<td class="description">The job ID</td></tr>
<tr><th>priority </th>
<td class="description">Priority (1-100)</td></tr>
<tr><th>processing_time </th>
<td class="description">Time the job was processed</td></tr>
<tr><th>size </th>
<td class="description">Size in kilobytes</td></tr>
<tr><th>state </th>
<td class="description">Job state</td></tr>
<tr><th>title </th>
<td class="description">Title/job name</td></tr>
<tr><th>user </th>
<td class="description">User that submitted the job</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_media_s">cups_media_s</a></h3>
<p class="description">Media information</p>
<p class="code"><span class="reserved">struct</span> cups_media_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">int</span> width, length, bottom, left, right, top;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> media[128], color[128], source[128], type[128];<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>top </th>
<td class="description">Top margin in hundredths of millimeters</td></tr>
<tr><th>type[128] </th>
<td class="description">Media type (blank for any/auto)</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
<p class="description">Printer Options</p>
<p class="code"><span class="reserved">struct</span> cups_option_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *name;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> *value;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>name </th>
<td class="description">Name of option</td></tr>
<tr><th>value </th>
<td class="description">Value of option</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_page_header_s">cups_page_header_s</a></h3>
<p class="description">Version 2 page header</p>
<p class="code"><span class="reserved">struct</span> cups_page_header_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> AdvanceDistance;<br>
&#160;&#160;&#160;&#160;<a href="#cups_adv_t">cups_adv_t</a> AdvanceMedia;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> Collate;<br>
&#160;&#160;&#160;&#160;<a href="#cups_cut_t">cups_cut_t</a> CutMedia;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> Duplex;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> HWResolution[2];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> ImagingBoundingBox[4];<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> InsertSheet;<br>
&#160;&#160;&#160;&#160;<a href="#cups_jog_t">cups_jog_t</a> Jog;<br>
&#160;&#160;&#160;&#160;<a href="#cups_edge_t">cups_edge_t</a> LeadingEdge;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> ManualFeed;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> Margins[2];<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> MediaClass[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> MediaColor[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> MediaPosition;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> MediaType[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> MediaWeight;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> MirrorPrint;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> NegativePrint;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> NumCopies;<br>
&#160;&#160;&#160;&#160;<a href="#cups_orient_t">cups_orient_t</a> Orientation;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> OutputFaceUp;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> OutputType[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> PageSize[2];<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> Separations;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> TraySwitch;<br>
&#160;&#160;&#160;&#160;<a href="#cups_bool_t">cups_bool_t</a> Tumble;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsBitsPerColor;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsBitsPerPixel;<br>
&#160;&#160;&#160;&#160;<span class="reserved">float</span> cupsBorderlessScalingFactor;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsBytesPerLine;<br>
&#160;&#160;&#160;&#160;<a href="#cups_order_t">cups_order_t</a> cupsColorOrder;<br>
&#160;&#160;&#160;&#160;<a href="#cups_cspace_t">cups_cspace_t</a> cupsColorSpace;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsCompression;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsHeight;<br>
&#160;&#160;&#160;&#160;<span class="reserved">float</span> cupsImagingBBox[4];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsInteger[16];<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> cupsMarkerType[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsMediaType;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsNumColors;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> cupsPageSizeName[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">float</span> cupsPageSize[2];<br>
&#160;&#160;&#160;&#160;<span class="reserved">float</span> cupsReal[16];<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> cupsRenderingIntent[64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsRowCount;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsRowFeed;<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsRowStep;<br>
&#160;&#160;&#160;&#160;<span class="reserved">char</span> cupsString[16][64];<br>
&#160;&#160;&#160;&#160;<span class="reserved">unsigned</span> cupsWidth;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>AdvanceDistance </th>
<td class="description">AdvanceDistance value in points</td></tr>
<tr><th>AdvanceMedia </th>
<td class="description">AdvanceMedia value (<a href="#cups_adv_t"><code>cups_adv_t</code></a>)</td></tr>
<tr><th>Collate </th>
<td class="description">Collated copies value</td></tr>
<tr><th>CutMedia </th>
<td class="description">CutMedia value (<a href="#cups_cut_t"><code>cups_cut_t</code></a>)</td></tr>
<tr><th>Duplex </th>
<td class="description">Duplexed (double-sided) value</td></tr>
<tr><th>HWResolution[2] </th>
<td class="description">Resolution in dots-per-inch</td></tr>
<tr><th>ImagingBoundingBox[4] </th>
<td class="description">Pixel region that is painted (points, left, bottom, right, top)</td></tr>
<tr><th>InsertSheet </th>
<td class="description">InsertSheet value</td></tr>
<tr><th>Jog </th>
<td class="description">Jog value (<a href="#cups_jog_t"><code>cups_jog_t</code></a>)</td></tr>
<tr><th>LeadingEdge </th>
<td class="description">LeadingEdge value (<a href="#cups_edge_t"><code>cups_edge_t</code></a>)</td></tr>
<tr><th>ManualFeed </th>
<td class="description">ManualFeed value</td></tr>
<tr><th>Margins[2] </th>
<td class="description">Lower-lefthand margins in points</td></tr>
<tr><th>MediaClass[64] </th>
<td class="description">MediaClass string</td></tr>
<tr><th>MediaColor[64] </th>
<td class="description">MediaColor string</td></tr>
<tr><th>MediaPosition </th>
<td class="description">MediaPosition value</td></tr>
<tr><th>MediaType[64] </th>
<td class="description">MediaType string</td></tr>
<tr><th>MediaWeight </th>
<td class="description">MediaWeight value in grams/m^2</td></tr>
<tr><th>MirrorPrint </th>
<td class="description">MirrorPrint value</td></tr>
<tr><th>NegativePrint </th>
<td class="description">NegativePrint value</td></tr>
<tr><th>NumCopies </th>
<td class="description">Number of copies to produce</td></tr>
<tr><th>Orientation </th>
<td class="description">Orientation value (<a href="#cups_orient_t"><code>cups_orient_t</code></a>)</td></tr>
<tr><th>OutputFaceUp </th>
<td class="description">OutputFaceUp value</td></tr>
<tr><th>OutputType[64] </th>
<td class="description">OutputType string</td></tr>
<tr><th>PageSize[2] </th>
<td class="description">Width and length of page in points</td></tr>
<tr><th>Separations </th>
<td class="description">Separations value</td></tr>
<tr><th>TraySwitch </th>
<td class="description">TraySwitch value</td></tr>
<tr><th>Tumble </th>
<td class="description">Tumble value</td></tr>
<tr><th>cupsBitsPerColor </th>
<td class="description">Number of bits for each color</td></tr>
<tr><th>cupsBitsPerPixel </th>
<td class="description">Number of bits for each pixel</td></tr>
<tr><th>cupsBorderlessScalingFactor </th>
<td class="description">Scaling that was applied to page data</td></tr>
<tr><th>cupsBytesPerLine </th>
<td class="description">Number of bytes per line</td></tr>
<tr><th>cupsColorOrder </th>
<td class="description">Order of colors</td></tr>
<tr><th>cupsColorSpace </th>
<td class="description">True colorspace</td></tr>
<tr><th>cupsCompression </th>
<td class="description">Device compression to use</td></tr>
<tr><th>cupsHeight </th>
<td class="description">Height of page image in pixels</td></tr>
<tr><th>cupsImagingBBox[4] </th>
<td class="description">Floating point ImagingBoundingBox
(scaling factor not applied, left,
bottom, right, top)</td></tr>
<tr><th>cupsInteger[16] </th>
<td class="description">User-defined integer values</td></tr>
<tr><th>cupsMarkerType[64] </th>
<td class="description">Ink/toner type</td></tr>
<tr><th>cupsMediaType </th>
<td class="description">Media type code</td></tr>
<tr><th>cupsNumColors </th>
<td class="description">Number of color compoents</td></tr>
<tr><th>cupsPageSizeName[64] </th>
<td class="description">PageSize name</td></tr>
<tr><th>cupsPageSize[2] </th>
<td class="description">Floating point PageSize (scaling *
factor not applied)</td></tr>
<tr><th>cupsReal[16] </th>
<td class="description">User-defined floating-point values</td></tr>
<tr><th>cupsRenderingIntent[64] </th>
<td class="description">Color rendering intent</td></tr>
<tr><th>cupsRowCount </th>
<td class="description">Rows per band</td></tr>
<tr><th>cupsRowFeed </th>
<td class="description">Feed between bands</td></tr>
<tr><th>cupsRowStep </th>
<td class="description">Spacing between lines</td></tr>
<tr><th>cupsString[16][64] </th>
<td class="description">User-defined string values</td></tr>
<tr><th>cupsWidth </th>
<td class="description">Width of page image in pixels</td></tr>
</tbody></table>
<h3 class="struct"><a id="http_addrlist_s">http_addrlist_s</a></h3>
<p class="description">Socket address list, which is used to enumerate all of the addresses that are associated with a hostname.</p>
<p class="code"><span class="reserved">struct</span> http_addrlist_s {<br>
&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> addr;<br>
&#160;&#160;&#160;&#160;<span class="reserved">struct</span> <a href="#http_addrlist_s">http_addrlist_s</a> *next;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>addr </th>
<td class="description">Address</td></tr>
<tr><th>next </th>
<td class="description">Pointer to next address in list</td></tr>
</tbody></table>
<h3 class="struct"><a id="pwg_media_s">pwg_media_s</a></h3>
<p class="description">Common media size data</p>
<p class="code"><span class="reserved">struct</span> pwg_media_s {<br>
&#160;&#160;&#160;&#160;<span class="reserved">int</span> width, length;<br>
&#160;&#160;&#160;&#160;<span class="reserved">const</span> <span class="reserved">char</span> *pwg, *legacy, *ppd;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>length </th>
<td class="description">Length in 2540ths</td></tr>
<tr><th>ppd </th>
<td class="description">Standard Adobe PPD name</td></tr>
</tbody></table>
<h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
<h3 class="enumeration"><a id="cups_adv_e">cups_adv_e</a></h3>
<p class="description">AdvanceMedia attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_ADVANCE_FILE </th><td class="description">Advance the roll after this file</td></tr>
<tr><th>CUPS_ADVANCE_JOB </th><td class="description">Advance the roll after this job</td></tr>
<tr><th>CUPS_ADVANCE_NONE </th><td class="description">Never advance the roll</td></tr>
<tr><th>CUPS_ADVANCE_PAGE </th><td class="description">Advance the roll after this page</td></tr>
<tr><th>CUPS_ADVANCE_SET </th><td class="description">Advance the roll after this set</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_bool_e">cups_bool_e</a></h3>
<p class="description">Boolean type</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_FALSE </th><td class="description">Logical false</td></tr>
<tr><th>CUPS_TRUE </th><td class="description">Logical true</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_credpurpose_e">cups_credpurpose_e</a></h3>
<p class="description">X.509 credential purposes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_CREDPURPOSE_ALL </th><td class="description">All purposes</td></tr>
<tr><th>CUPS_CREDPURPOSE_CLIENT_AUTH </th><td class="description">clientAuth</td></tr>
<tr><th>CUPS_CREDPURPOSE_CODE_SIGNING </th><td class="description">codeSigning</td></tr>
<tr><th>CUPS_CREDPURPOSE_EMAIL_PROTECTION </th><td class="description">emailProtection</td></tr>
<tr><th>CUPS_CREDPURPOSE_OCSP_SIGNING </th><td class="description">OCSPSigning</td></tr>
<tr><th>CUPS_CREDPURPOSE_SERVER_AUTH </th><td class="description">serverAuth</td></tr>
<tr><th>CUPS_CREDPURPOSE_TIME_STAMPING </th><td class="description">timeStamping</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_credtype_e">cups_credtype_e</a></h3>
<p class="description">X.509 credential types for <a href="#cupsCreateCredentials"><code>cupsCreateCredentials</code></a> and <a href="#cupsCreateCredentialsRequest"><code>cupsCreateCredentialsRequest</code></a></p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_CREDTYPE_DEFAULT </th><td class="description">Default type</td></tr>
<tr><th>CUPS_CREDTYPE_ECDSA_P256_SHA256 </th><td class="description">ECDSA using the P-256 curve with SHA-256 hash</td></tr>
<tr><th>CUPS_CREDTYPE_ECDSA_P384_SHA256 </th><td class="description">ECDSA using the P-384 curve with SHA-256 hash</td></tr>
<tr><th>CUPS_CREDTYPE_ECDSA_P521_SHA256 </th><td class="description">ECDSA using the P-521 curve with SHA-256 hash</td></tr>
<tr><th>CUPS_CREDTYPE_RSA_2048_SHA256 </th><td class="description">RSA with 2048-bit keys and SHA-256 hash</td></tr>
<tr><th>CUPS_CREDTYPE_RSA_3072_SHA256 </th><td class="description">RSA with 3072-bit keys and SHA-256 hash</td></tr>
<tr><th>CUPS_CREDTYPE_RSA_4096_SHA256 </th><td class="description">RSA with 4096-bit keys and SHA-256 hash</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_credusage_e">cups_credusage_e</a></h3>
<p class="description">X.509 keyUsage flags</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_CREDUSAGE_ALL </th><td class="description">All keyUsage flags</td></tr>
<tr><th>CUPS_CREDUSAGE_CRL_SIGN </th><td class="description">cRLSign</td></tr>
<tr><th>CUPS_CREDUSAGE_DATA_ENCIPHERMENT </th><td class="description">dataEncipherment</td></tr>
<tr><th>CUPS_CREDUSAGE_DECIPHER_ONLY </th><td class="description">decipherOnly</td></tr>
<tr><th>CUPS_CREDUSAGE_DEFAULT_CA </th><td class="description">Defaults for CA certs</td></tr>
<tr><th>CUPS_CREDUSAGE_DEFAULT_TLS </th><td class="description">Defaults for TLS certs</td></tr>
<tr><th>CUPS_CREDUSAGE_DIGITAL_SIGNATURE </th><td class="description">digitalSignature</td></tr>
<tr><th>CUPS_CREDUSAGE_ENCIPHER_ONLY </th><td class="description">encipherOnly</td></tr>
<tr><th>CUPS_CREDUSAGE_KEY_AGREEMENT </th><td class="description">keyAgreement</td></tr>
<tr><th>CUPS_CREDUSAGE_KEY_CERT_SIGN </th><td class="description">keyCertSign</td></tr>
<tr><th>CUPS_CREDUSAGE_KEY_ENCIPHERMENT </th><td class="description">keyEncipherment</td></tr>
<tr><th>CUPS_CREDUSAGE_NON_REPUDIATION </th><td class="description">nonRepudiation/contentCommitment</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_cspace_e">cups_cspace_e</a></h3>
<p class="description">cupsColorSpace attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_CSPACE_ADOBERGB </th><td class="description">Red, green, blue (Adobe RGB)</td></tr>
<tr><th>CUPS_CSPACE_CIELab </th><td class="description">CIE Lab</td></tr>
<tr><th>CUPS_CSPACE_CIEXYZ </th><td class="description">CIE XYZ</td></tr>
<tr><th>CUPS_CSPACE_CMY </th><td class="description">Cyan, magenta, yellow (DeviceCMY)</td></tr>
<tr><th>CUPS_CSPACE_CMYK </th><td class="description">Cyan, magenta, yellow, black (DeviceCMYK)</td></tr>
<tr><th>CUPS_CSPACE_DEVICE1 </th><td class="description">DeviceN, 1 color</td></tr>
<tr><th>CUPS_CSPACE_DEVICE2 </th><td class="description">DeviceN, 2 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE3 </th><td class="description">DeviceN, 3 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE4 </th><td class="description">DeviceN, 4 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE5 </th><td class="description">DeviceN, 5 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE6 </th><td class="description">DeviceN, 6 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE7 </th><td class="description">DeviceN, 7 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE8 </th><td class="description">DeviceN, 8 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICE9 </th><td class="description">DeviceN, 9 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICEA </th><td class="description">DeviceN, 10 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICEB </th><td class="description">DeviceN, 11 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICEC </th><td class="description">DeviceN, 12 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICED </th><td class="description">DeviceN, 13 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICEE </th><td class="description">DeviceN, 14 colors</td></tr>
<tr><th>CUPS_CSPACE_DEVICEF </th><td class="description">DeviceN, 15 colors</td></tr>
<tr><th>CUPS_CSPACE_GMCK <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Gold, magenta, yellow, black </td></tr>
<tr><th>CUPS_CSPACE_GMCS <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Gold, magenta, yellow, silver </td></tr>
<tr><th>CUPS_CSPACE_GOLD <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Gold foil </td></tr>
<tr><th>CUPS_CSPACE_ICC1 </th><td class="description">ICC-based, 1 color</td></tr>
<tr><th>CUPS_CSPACE_ICC2 </th><td class="description">ICC-based, 2 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC3 </th><td class="description">ICC-based, 3 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC4 </th><td class="description">ICC-based, 4 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC5 </th><td class="description">ICC-based, 5 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC6 </th><td class="description">ICC-based, 6 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC7 </th><td class="description">ICC-based, 7 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC8 </th><td class="description">ICC-based, 8 colors</td></tr>
<tr><th>CUPS_CSPACE_ICC9 </th><td class="description">ICC-based, 9 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCA </th><td class="description">ICC-based, 10 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCB </th><td class="description">ICC-based, 11 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCC </th><td class="description">ICC-based, 12 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCD </th><td class="description">ICC-based, 13 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCE </th><td class="description">ICC-based, 14 colors</td></tr>
<tr><th>CUPS_CSPACE_ICCF </th><td class="description">ICC-based, 15 colors</td></tr>
<tr><th>CUPS_CSPACE_K </th><td class="description">Black (DeviceK)</td></tr>
<tr><th>CUPS_CSPACE_KCMY <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Black, cyan, magenta, yellow </td></tr>
<tr><th>CUPS_CSPACE_KCMYcm <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Black, cyan, magenta, yellow, light-cyan, light-magenta </td></tr>
<tr><th>CUPS_CSPACE_RGB </th><td class="description">Red, green, blue (DeviceRGB, sRGB by default)</td></tr>
<tr><th>CUPS_CSPACE_RGBA </th><td class="description">Red, green, blue, alpha (DeviceRGB, sRGB by default)</td></tr>
<tr><th>CUPS_CSPACE_RGBW </th><td class="description">Red, green, blue, white (DeviceRGB, sRGB by default)</td></tr>
<tr><th>CUPS_CSPACE_SILVER <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Silver foil </td></tr>
<tr><th>CUPS_CSPACE_SRGB </th><td class="description">Red, green, blue (sRGB)</td></tr>
<tr><th>CUPS_CSPACE_SW </th><td class="description">Luminance (gamma 2.2)</td></tr>
<tr><th>CUPS_CSPACE_W </th><td class="description">Luminance (DeviceGray, gamma 2.2 by default)</td></tr>
<tr><th>CUPS_CSPACE_WHITE <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">White ink (as black) </td></tr>
<tr><th>CUPS_CSPACE_YMC <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Yellow, magenta, cyan </td></tr>
<tr><th>CUPS_CSPACE_YMCK <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Yellow, magenta, cyan, black </td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_cut_e">cups_cut_e</a></h3>
<p class="description">CutMedia attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_CUT_FILE </th><td class="description">Cut the roll after this file</td></tr>
<tr><th>CUPS_CUT_JOB </th><td class="description">Cut the roll after this job</td></tr>
<tr><th>CUPS_CUT_NONE </th><td class="description">Never cut the roll</td></tr>
<tr><th>CUPS_CUT_PAGE </th><td class="description">Cut the roll after this page</td></tr>
<tr><th>CUPS_CUT_SET </th><td class="description">Cut the roll after this set</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_dest_flags_e">cups_dest_flags_e</a></h3>
<p class="description">Flags for <a href="#cupsConnectDest"><code>cupsConnectDest</code></a> and <a href="#cupsEnumDests"><code>cupsEnumDests</code></a></p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_DEST_FLAGS_CANCELED </th><td class="description">Operation was canceled</td></tr>
<tr><th>CUPS_DEST_FLAGS_CONNECTING </th><td class="description">A connection is being established</td></tr>
<tr><th>CUPS_DEST_FLAGS_DEVICE </th><td class="description">For <a href="#cupsConnectDest"><code>cupsConnectDest</code></a>: Connect to device</td></tr>
<tr><th>CUPS_DEST_FLAGS_ERROR </th><td class="description">An error occurred</td></tr>
<tr><th>CUPS_DEST_FLAGS_MORE </th><td class="description">There are more destinations</td></tr>
<tr><th>CUPS_DEST_FLAGS_NONE </th><td class="description">No flags are set</td></tr>
<tr><th>CUPS_DEST_FLAGS_REMOVED </th><td class="description">The destination has gone away</td></tr>
<tr><th>CUPS_DEST_FLAGS_RESOLVING </th><td class="description">The destination address is being resolved</td></tr>
<tr><th>CUPS_DEST_FLAGS_UNCONNECTED </th><td class="description">There is no connection</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_dnssd_flags_e">cups_dnssd_flags_e</a></h3>
<p class="description">DNS-SD callback flag values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_DNSSD_FLAGS_ADD </th><td class="description">Added (removed if not set)</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_COLLISION </th><td class="description">Collision occurred</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_ERROR </th><td class="description">Error occurred</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_HOST_CHANGE </th><td class="description">Host name changed</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_MORE </th><td class="description">More coming</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_NETWORK_CHANGE </th><td class="description">Network connection changed</td></tr>
<tr><th>CUPS_DNSSD_FLAGS_NONE </th><td class="description">No flags</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_dnssd_rrtype_e">cups_dnssd_rrtype_e</a></h3>
<p class="description">DNS record type values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_DNSSD_RRTYPE_A </th><td class="description">Host address</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_AAAA </th><td class="description">IPv6 Address.</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_ANY </th><td class="description">Wildcard match</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_CERT </th><td class="description">Certification record</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_CNAME </th><td class="description">Canonical name</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_DHCID </th><td class="description">DHCP Client Identifier</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_DNSKEY </th><td class="description">DNSKEY</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_HTTPS </th><td class="description">HTTPS Service Binding</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_KEY </th><td class="description">Security key</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_KX </th><td class="description">Key Exchange</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_LOC </th><td class="description">Location Information.</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_NS </th><td class="description">Name server</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_PTR </th><td class="description">Domain name pointer</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_RRSIG </th><td class="description">RRSIG</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_RT </th><td class="description">Router</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_SIG </th><td class="description">Security signature</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_SPF </th><td class="description">Sender Policy Framework for E-Mail</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_TXT </th><td class="description">One or more text strings</td></tr>
<tr><th>CUPS_DNSSD_RRTYPE_WKS </th><td class="description">Well known service</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_edge_e">cups_edge_e</a></h3>
<p class="description">LeadingEdge attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_EDGE_BOTTOM </th><td class="description">Leading edge is the bottom of the page</td></tr>
<tr><th>CUPS_EDGE_LEFT </th><td class="description">Leading edge is the left of the page</td></tr>
<tr><th>CUPS_EDGE_RIGHT </th><td class="description">Leading edge is the right of the page</td></tr>
<tr><th>CUPS_EDGE_TOP </th><td class="description">Leading edge is the top of the page</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_encoding_e">cups_encoding_e</a></h3>
<p class="description">Language Encodings</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_ENCODING_BG18030 </th><td class="description">Chinese GB 18030</td></tr>
<tr><th>CUPS_ENCODING_EUC_CN </th><td class="description">EUC Simplified Chinese</td></tr>
<tr><th>CUPS_ENCODING_EUC_JP </th><td class="description">EUC Japanese</td></tr>
<tr><th>CUPS_ENCODING_EUC_KR </th><td class="description">EUC Korean</td></tr>
<tr><th>CUPS_ENCODING_EUC_TW </th><td class="description">EUC Traditional Chinese</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_1 </th><td class="description">ISO-8859-1</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_10 </th><td class="description">ISO-8859-10</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_11 </th><td class="description">ISO-8859-11</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_13 </th><td class="description">ISO-8859-13</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_14 </th><td class="description">ISO-8859-14</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_15 </th><td class="description">ISO-8859-15</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_16 </th><td class="description">ISO-8859-16</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_2 </th><td class="description">ISO-8859-2</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_3 </th><td class="description">ISO-8859-3</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_4 </th><td class="description">ISO-8859-4</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_5 </th><td class="description">ISO-8859-5</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_6 </th><td class="description">ISO-8859-6</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_7 </th><td class="description">ISO-8859-7</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_8 </th><td class="description">ISO-8859-8</td></tr>
<tr><th>CUPS_ENCODING_ISO8859_9 </th><td class="description">ISO-8859-9</td></tr>
<tr><th>CUPS_ENCODING_JIS_X0213 </th><td class="description">JIS X0213 aka Shift JIS</td></tr>
<tr><th>CUPS_ENCODING_KOI8_R </th><td class="description">KOI-8-R</td></tr>
<tr><th>CUPS_ENCODING_KOI8_U </th><td class="description">KOI-8-U</td></tr>
<tr><th>CUPS_ENCODING_MAC_ROMAN </th><td class="description">MacRoman</td></tr>
<tr><th>CUPS_ENCODING_US_ASCII </th><td class="description">US ASCII</td></tr>
<tr><th>CUPS_ENCODING_UTF_8 </th><td class="description">UTF-8</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1250 </th><td class="description">CP-1250</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1251 </th><td class="description">CP-1251</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1252 </th><td class="description">CP-1252</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1253 </th><td class="description">CP-1253</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1254 </th><td class="description">CP-1254</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1255 </th><td class="description">CP-1255</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1256 </th><td class="description">CP-1256</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1257 </th><td class="description">CP-1257</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1258 </th><td class="description">CP-1258</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_1361 </th><td class="description">Korean Johab</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_874 </th><td class="description">CP-874</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_932 </th><td class="description">Japanese JIS X0208-1990</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_936 </th><td class="description">Simplified Chinese GB 2312-80</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_949 </th><td class="description">Korean KS C5601-1992</td></tr>
<tr><th>CUPS_ENCODING_WINDOWS_950 </th><td class="description">Traditional Chinese Big Five</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_jog_e">cups_jog_e</a></h3>
<p class="description">Jog attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_JOG_FILE </th><td class="description">Move pages after this file</td></tr>
<tr><th>CUPS_JOG_JOB </th><td class="description">Move pages after this job</td></tr>
<tr><th>CUPS_JOG_NONE </th><td class="description">Never move pages</td></tr>
<tr><th>CUPS_JOG_SET </th><td class="description">Move pages after this set</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_jtype_e">cups_jtype_e</a></h3>
<p class="description">JSON node type</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_JTYPE_ARRAY </th><td class="description">Array value</td></tr>
<tr><th>CUPS_JTYPE_FALSE </th><td class="description">Boolean false value</td></tr>
<tr><th>CUPS_JTYPE_KEY </th><td class="description">Object key (string)</td></tr>
<tr><th>CUPS_JTYPE_NULL </th><td class="description">Null value</td></tr>
<tr><th>CUPS_JTYPE_NUMBER </th><td class="description">Number value</td></tr>
<tr><th>CUPS_JTYPE_OBJECT </th><td class="description">Object value</td></tr>
<tr><th>CUPS_JTYPE_STRING </th><td class="description">String value</td></tr>
<tr><th>CUPS_JTYPE_TRUE </th><td class="description">Boolean true value</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_jwa_e">cups_jwa_e</a></h3>
<p class="description">JSON Web Algorithms</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_JWA_ES256 </th><td class="description">ECDSA using P-256 and SHA-256</td></tr>
<tr><th>CUPS_JWA_ES384 </th><td class="description">ECDSA using P-384 and SHA-384</td></tr>
<tr><th>CUPS_JWA_ES512 </th><td class="description">ECDSA using P-521 and SHA-512</td></tr>
<tr><th>CUPS_JWA_HS256 </th><td class="description">HMAC using SHA-256</td></tr>
<tr><th>CUPS_JWA_HS384 </th><td class="description">HMAC using SHA-384</td></tr>
<tr><th>CUPS_JWA_HS512 </th><td class="description">HMAC using SHA-512</td></tr>
<tr><th>CUPS_JWA_NONE </th><td class="description">No algorithm</td></tr>
<tr><th>CUPS_JWA_RS256 </th><td class="description">RSASSA-PKCS1-v1_5 using SHA-256</td></tr>
<tr><th>CUPS_JWA_RS384 </th><td class="description">RSASSA-PKCS1-v1_5 using SHA-384</td></tr>
<tr><th>CUPS_JWA_RS512 </th><td class="description">RSASSA-PKCS1-v1_5 using SHA-512</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_jws_format_e">cups_jws_format_e</a></h3>
<p class="description">JSON Web Signature Formats</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_JWS_FORMAT_COMPACT </th><td class="description">JWS Compact Serialization</td></tr>
<tr><th>CUPS_JWS_FORMAT_JSON </th><td class="description">JWS JSON Serialization</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_media_flags_e">cups_media_flags_e</a></h3>
<p class="description">Flags for <a href="#cupsGetDestMediaByName"><code>cupsGetDestMediaByName</code></a> and <a href="#cupsGetDestMediaBySize"><code>cupsGetDestMediaBySize</code></a></p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_MEDIA_FLAGS_BORDERLESS </th><td class="description">Find a borderless size</td></tr>
<tr><th>CUPS_MEDIA_FLAGS_DEFAULT </th><td class="description">Find the closest size supported by the printer</td></tr>
<tr><th>CUPS_MEDIA_FLAGS_DUPLEX </th><td class="description">Find a size compatible with 2-sided printing</td></tr>
<tr><th>CUPS_MEDIA_FLAGS_EXACT </th><td class="description">Find an exact match for the size</td></tr>
<tr><th>CUPS_MEDIA_FLAGS_READY </th><td class="description">If the printer supports media sensing, find the size amongst the &quot;ready&quot; media.</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_mediapos_e">cups_mediapos_e</a></h3>
<p class="description">MediaPosition values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_MEDIAPOS_ALTERNATE </th><td class="description">'alternate'</td></tr>
<tr><th>CUPS_MEDIAPOS_ALTERNATE_ROLL </th><td class="description">'alternate-roll'</td></tr>
<tr><th>CUPS_MEDIAPOS_AUTO </th><td class="description">'auto'</td></tr>
<tr><th>CUPS_MEDIAPOS_BOTTOM </th><td class="description">'bottom'</td></tr>
<tr><th>CUPS_MEDIAPOS_BY_PASS_TRAY </th><td class="description">'by-pass-tray'</td></tr>
<tr><th>CUPS_MEDIAPOS_CENTER </th><td class="description">'center'</td></tr>
<tr><th>CUPS_MEDIAPOS_DISC </th><td class="description">'disc'</td></tr>
<tr><th>CUPS_MEDIAPOS_ENVELOPE </th><td class="description">'envelope'</td></tr>
<tr><th>CUPS_MEDIAPOS_HAGAKI </th><td class="description">'hagaki'</td></tr>
<tr><th>CUPS_MEDIAPOS_LARGE_CAPACITY </th><td class="description">'large-capacity'</td></tr>
<tr><th>CUPS_MEDIAPOS_LEFT </th><td class="description">'left'</td></tr>
<tr><th>CUPS_MEDIAPOS_MAIN </th><td class="description">'main'</td></tr>
<tr><th>CUPS_MEDIAPOS_MAIN_ROLL </th><td class="description">'main-roll'</td></tr>
<tr><th>CUPS_MEDIAPOS_MANUAL </th><td class="description">'manual'</td></tr>
<tr><th>CUPS_MEDIAPOS_MIDDLE </th><td class="description">'middle'</td></tr>
<tr><th>CUPS_MEDIAPOS_PHOTO </th><td class="description">'photo'</td></tr>
<tr><th>CUPS_MEDIAPOS_REAR </th><td class="description">'rear'</td></tr>
<tr><th>CUPS_MEDIAPOS_RIGHT </th><td class="description">'right'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_1 </th><td class="description">'roll-1'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_10 </th><td class="description">'roll-10'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_2 </th><td class="description">'roll-2'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_3 </th><td class="description">'roll-3'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_4 </th><td class="description">'roll-4'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_5 </th><td class="description">'roll-5'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_6 </th><td class="description">'roll-6'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_7 </th><td class="description">'roll-7'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_8 </th><td class="description">'roll-8'</td></tr>
<tr><th>CUPS_MEDIAPOS_ROLL_9 </th><td class="description">'roll-9'</td></tr>
<tr><th>CUPS_MEDIAPOS_SIDE </th><td class="description">'side'</td></tr>
<tr><th>CUPS_MEDIAPOS_TOP </th><td class="description">'top'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_1 </th><td class="description">'tray-1'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_10 </th><td class="description">'tray-10'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_11 </th><td class="description">'tray-11'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_12 </th><td class="description">'tray-12'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_13 </th><td class="description">'tray-13'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_14 </th><td class="description">'tray-14'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_15 </th><td class="description">'tray-15'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_16 </th><td class="description">'tray-16'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_17 </th><td class="description">'tray-17'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_18 </th><td class="description">'tray-18'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_19 </th><td class="description">'tray-19'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_2 </th><td class="description">'tray-2'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_20 </th><td class="description">'tray-20'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_3 </th><td class="description">'tray-3'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_4 </th><td class="description">'tray-4'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_5 </th><td class="description">'tray-5'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_6 </th><td class="description">'tray-6'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_7 </th><td class="description">'tray-7'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_8 </th><td class="description">'tray-8'</td></tr>
<tr><th>CUPS_MEDIAPOS_TRAY_9 </th><td class="description">'tray-9'</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_ogrant_e">cups_ogrant_e</a></h3>
<p class="description">OAuth Grant Types</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_OGRANT_AUTHORIZATION_CODE </th><td class="description">Authorization code</td></tr>
<tr><th>CUPS_OGRANT_DEVICE_CODE </th><td class="description">Device code</td></tr>
<tr><th>CUPS_OGRANT_REFRESH_TOKEN </th><td class="description">Refresh token</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_order_e">cups_order_e</a></h3>
<p class="description">cupsColorOrder attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_ORDER_BANDED </th><td class="description">CCC MMM YYY KKK ...</td></tr>
<tr><th>CUPS_ORDER_CHUNKED </th><td class="description">CMYK CMYK CMYK ...</td></tr>
<tr><th>CUPS_ORDER_PLANAR </th><td class="description">CCC ... MMM ... YYY ... KKK ...</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_orient_e">cups_orient_e</a></h3>
<p class="description">Orientation attribute values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_ORIENT_0 </th><td class="description">Don't rotate the page</td></tr>
<tr><th>CUPS_ORIENT_180 </th><td class="description">Turn the page upside down</td></tr>
<tr><th>CUPS_ORIENT_270 </th><td class="description">Rotate the page clockwise</td></tr>
<tr><th>CUPS_ORIENT_90 </th><td class="description">Rotate the page counter-clockwise</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
<p class="description">Printer type/capability flags</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_PTYPE_AUTHENTICATED </th><td class="description">Printer requires authentication</td></tr>
<tr><th>CUPS_PTYPE_BIND </th><td class="description">Can bind output</td></tr>
<tr><th>CUPS_PTYPE_BW </th><td class="description">Can do B&amp;W printing</td></tr>
<tr><th>CUPS_PTYPE_CLASS </th><td class="description">Printer class</td></tr>
<tr><th>CUPS_PTYPE_COLLATE </th><td class="description">Can quickly collate copies</td></tr>
<tr><th>CUPS_PTYPE_COLOR </th><td class="description">Can do color printing</td></tr>
<tr><th>CUPS_PTYPE_COMMANDS </th><td class="description">Printer supports maintenance commands</td></tr>
<tr><th>CUPS_PTYPE_COPIES </th><td class="description">Can do copies in hardware</td></tr>
<tr><th>CUPS_PTYPE_COVER </th><td class="description">Can cover output</td></tr>
<tr><th>CUPS_PTYPE_DEFAULT </th><td class="description">Default printer on network</td></tr>
<tr><th>CUPS_PTYPE_DISCOVERED </th><td class="description">Printer was discovered</td></tr>
<tr><th>CUPS_PTYPE_DUPLEX </th><td class="description">Can do two-sided printing</td></tr>
<tr><th>CUPS_PTYPE_FAX </th><td class="description">Fax queue</td></tr>
<tr><th>CUPS_PTYPE_FOLD </th><td class="description">Can fold output</td></tr>
<tr><th>CUPS_PTYPE_LARGE </th><td class="description">Can print on D/E/A1/A0-size media</td></tr>
<tr><th>CUPS_PTYPE_LOCAL </th><td class="description">Local printer or class</td></tr>
<tr><th>CUPS_PTYPE_MEDIUM </th><td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
<tr><th>CUPS_PTYPE_MFP </th><td class="description">Printer with scanning capabilities</td></tr>
<tr><th>CUPS_PTYPE_NOT_SHARED </th><td class="description">Printer is not shared</td></tr>
<tr><th>CUPS_PTYPE_PUNCH </th><td class="description">Can punch output</td></tr>
<tr><th>CUPS_PTYPE_REJECTING </th><td class="description">Printer is rejecting jobs</td></tr>
<tr><th>CUPS_PTYPE_REMOTE </th><td class="description">Remote printer or class</td></tr>
<tr><th>CUPS_PTYPE_SCANNER </th><td class="description">Scanner-only device</td></tr>
<tr><th>CUPS_PTYPE_SMALL </th><td class="description">Can print on Letter/Legal/A4-size media</td></tr>
<tr><th>CUPS_PTYPE_SORT </th><td class="description">Can sort output</td></tr>
<tr><th>CUPS_PTYPE_STAPLE </th><td class="description">Can staple output</td></tr>
<tr><th>CUPS_PTYPE_VARIABLE </th><td class="description">Can print on rolls and custom-size media</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_raster_mode_e">cups_raster_mode_e</a></h3>
<p class="description">cupsRasterOpen modes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_RASTER_READ </th><td class="description">Open stream for reading</td></tr>
<tr><th>CUPS_RASTER_WRITE </th><td class="description">Open stream for writing</td></tr>
<tr><th>CUPS_RASTER_WRITE_COMPRESSED </th><td class="description">Open stream for compressed writing</td></tr>
<tr><th>CUPS_RASTER_WRITE_PWG </th><td class="description">Open stream for compressed writing in PWG Raster mode</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="cups_whichjobs_e">cups_whichjobs_e</a></h3>
<p class="description">Which jobs for <a href="#cupsGetJobs"><code>cupsGetJobs</code></a></p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_WHICHJOBS_ACTIVE </th><td class="description">Pending/held/processing jobs</td></tr>
<tr><th>CUPS_WHICHJOBS_ALL </th><td class="description">All jobs</td></tr>
<tr><th>CUPS_WHICHJOBS_COMPLETED </th><td class="description">Completed/canceled/aborted jobs</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
<p class="description">HTTP transfer encoding values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_ENCODING_CHUNKED </th><td class="description">Data is chunked</td></tr>
<tr><th>HTTP_ENCODING_FIELDS </th><td class="description">Sending HTTP fields</td></tr>
<tr><th>HTTP_ENCODING_LENGTH </th><td class="description">Data is sent with Content-Length</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
<p class="description">HTTP encryption values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_ENCRYPTION_ALWAYS </th><td class="description">Always encrypt (HTTPS)</td></tr>
<tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th><td class="description">Encrypt if requested (TLS upgrade)</td></tr>
<tr><th>HTTP_ENCRYPTION_NEVER </th><td class="description">Never encrypt</td></tr>
<tr><th>HTTP_ENCRYPTION_REQUIRED </th><td class="description">Encryption is required (TLS upgrade)</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
<p class="description">HTTP field names</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_FIELD_ACCEPT </th><td class="description">Accept field</td></tr>
<tr><th>HTTP_FIELD_ACCEPT_CH </th><td class="description">RFC 8942 Accept-CH field</td></tr>
<tr><th>HTTP_FIELD_ACCEPT_ENCODING </th><td class="description">Accept-Encoding field</td></tr>
<tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th><td class="description">Accept-Language field</td></tr>
<tr><th>HTTP_FIELD_ACCEPT_RANGES </th><td class="description">Accept-Ranges field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_ALLOW_CREDENTIALS </th><td class="description">CORS/Fetch Access-Control-Allow-Cresdentials field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_ALLOW_HEADERS </th><td class="description">CORS/Fetch Access-Control-Allow-Headers field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_ALLOW_METHODS </th><td class="description">CORS/Fetch Access-Control-Allow-Methods field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_ALLOW_ORIGIN </th><td class="description">CORS/Fetch Access-Control-Allow-Origin field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_EXPOSE_HEADERS </th><td class="description">CORS/Fetch Access-Control-Expose-Headers field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_MAX_AGE </th><td class="description">CORS/Fetch Access-Control-Max-Age field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_REQUEST_HEADERS </th><td class="description">CORS/Fetch Access-Control-Request-Headers field</td></tr>
<tr><th>HTTP_FIELD_ACCESS_CONTROL_REQUEST_METHOD </th><td class="description">CORS/Fetch Access-Control-Request-Method field</td></tr>
<tr><th>HTTP_FIELD_AGE </th><td class="description">Age field</td></tr>
<tr><th>HTTP_FIELD_ALLOW </th><td class="description">Allow field</td></tr>
<tr><th>HTTP_FIELD_AUTHENTICATION_CONTROL </th><td class="description">RFC 8053 Authentication-Control field</td></tr>
<tr><th>HTTP_FIELD_AUTHENTICATION_INFO </th><td class="description">Authentication-Info field</td></tr>
<tr><th>HTTP_FIELD_AUTHORIZATION </th><td class="description">Authorization field</td></tr>
<tr><th>HTTP_FIELD_CACHE_CONTROL </th><td class="description">Cache-Control field</td></tr>
<tr><th>HTTP_FIELD_CACHE_STATUS </th><td class="description">Cache-Status field</td></tr>
<tr><th>HTTP_FIELD_CERT_NOT_AFTER </th><td class="description">RFC 8739 (ACME) Cert-Not-After field</td></tr>
<tr><th>HTTP_FIELD_CERT_NOT_BEFORE </th><td class="description">RFC 8739 (ACME) Cert-Not-Before field</td></tr>
<tr><th>HTTP_FIELD_CONNECTION </th><td class="description">Connection field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_DISPOSITION </th><td class="description">RFC 6266 Content-Disposition field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_ENCODING </th><td class="description">Content-Encoding field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th><td class="description">Content-Language field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LENGTH </th><td class="description">Content-Length field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LOCATION </th><td class="description">Content-Location field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_RANGE </th><td class="description">Content-Range field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_SECURITY_POLICY </th><td class="description">CSPL3 Content-Security-Policy field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_SECURITY_POLICY_REPORT_ONLY </th><td class="description">CSPL3 Content-Security-Policy-Report-Only field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_TYPE </th><td class="description">Content-Type field</td></tr>
<tr><th>HTTP_FIELD_CROSS_ORIGIN_EMBEDDER_POLICY </th><td class="description">WHATWG Cross-Origin-Embedder-Policy field</td></tr>
<tr><th>HTTP_FIELD_CROSS_ORIGIN_EMBEDDER_POLICY_REPORT_ONLY </th><td class="description">WHATWG Cross-Origin-Embedder-Policy-Report-Only field</td></tr>
<tr><th>HTTP_FIELD_CROSS_ORIGIN_OPENER_POLICY </th><td class="description">WHATWG Cross-Origin-Opener-Policy field</td></tr>
<tr><th>HTTP_FIELD_CROSS_ORIGIN_OPENER_POLICY_REPORT_ONLY </th><td class="description">WHATWG Cross-Origin-Opener-Policy-Report-Only field</td></tr>
<tr><th>HTTP_FIELD_CROSS_ORIGIN_RESOURCE_POLICY </th><td class="description">WHATWG Cross-Origin-Resource-Policy field</td></tr>
<tr><th>HTTP_FIELD_DASL </th><td class="description">RFC 5323 (WebDAV) DASL field</td></tr>
<tr><th>HTTP_FIELD_DATE </th><td class="description">Date field</td></tr>
<tr><th>HTTP_FIELD_DAV </th><td class="description">RFC 4918 (WebDAV) DAV field</td></tr>
<tr><th>HTTP_FIELD_DEPTH </th><td class="description">RFC 4918 (WebDAV) Depth field</td></tr>
<tr><th>HTTP_FIELD_DESTINATION </th><td class="description">RFC 4918 (WebDAV) Destination field</td></tr>
<tr><th>HTTP_FIELD_ETAG </th><td class="description">ETag field</td></tr>
<tr><th>HTTP_FIELD_EXPIRES </th><td class="description">Expires field</td></tr>
<tr><th>HTTP_FIELD_FORWARDED </th><td class="description">RFC 7239 Forwarded field</td></tr>
<tr><th>HTTP_FIELD_FROM </th><td class="description">From field</td></tr>
<tr><th>HTTP_FIELD_HOST </th><td class="description">Host field</td></tr>
<tr><th>HTTP_FIELD_IF </th><td class="description">RFC 4918 (WebDAV) If field</td></tr>
<tr><th>HTTP_FIELD_IF_MATCH </th><td class="description">If-Match field</td></tr>
<tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th><td class="description">If-Modified-Since field</td></tr>
<tr><th>HTTP_FIELD_IF_NONE_MATCH </th><td class="description">If-None-Match field</td></tr>
<tr><th>HTTP_FIELD_IF_RANGE </th><td class="description">If-Range field</td></tr>
<tr><th>HTTP_FIELD_IF_SCHEDULE_TAG_MATCH </th><td class="description">RFC 6638 (CalDAV) If-Schedule-Tag-Match field</td></tr>
<tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th><td class="description">If-Unmodified-Since field</td></tr>
<tr><th>HTTP_FIELD_KEEP_ALIVE </th><td class="description">Keep-Alive field</td></tr>
<tr><th>HTTP_FIELD_LAST_MODIFIED </th><td class="description">Last-Modified field</td></tr>
<tr><th>HTTP_FIELD_LINK </th><td class="description">Link field</td></tr>
<tr><th>HTTP_FIELD_LOCATION </th><td class="description">Location field</td></tr>
<tr><th>HTTP_FIELD_LOCK_TOKEN </th><td class="description">RFC 4918 (WebDAV) Lock-Token field</td></tr>
<tr><th>HTTP_FIELD_MAX </th><td class="description">Maximum field index</td></tr>
<tr><th>HTTP_FIELD_MAX_FORWARDS </th><td class="description">Max-Forwards field</td></tr>
<tr><th>HTTP_FIELD_OPTIONAL_WWW_AUTHENTICATE </th><td class="description">RFC 8053 Optional-WWW-Authenticate field</td></tr>
<tr><th>HTTP_FIELD_ORIGIN </th><td class="description">RFC 6454 Origin field</td></tr>
<tr><th>HTTP_FIELD_OSCORE </th><td class="description">RFC 8613 OSCORE field</td></tr>
<tr><th>HTTP_FIELD_OVERWRITE </th><td class="description">RFC 4918 (WebDAV) Overwrite field</td></tr>
<tr><th>HTTP_FIELD_PRAGMA </th><td class="description">Pragma field</td></tr>
<tr><th>HTTP_FIELD_PROXY_AUTHENTICATE </th><td class="description">Proxy-Authenticate field</td></tr>
<tr><th>HTTP_FIELD_PROXY_AUTHENTICATION_INFO </th><td class="description">Proxy-Authentication-Info field</td></tr>
<tr><th>HTTP_FIELD_PROXY_AUTHORIZATION </th><td class="description">Proxy-Authorization field</td></tr>
<tr><th>HTTP_FIELD_PROXY_STATUS </th><td class="description">Proxy-Status field</td></tr>
<tr><th>HTTP_FIELD_PUBLIC </th><td class="description">Public field</td></tr>
<tr><th>HTTP_FIELD_RANGE </th><td class="description">Range field</td></tr>
<tr><th>HTTP_FIELD_REFERER </th><td class="description">Referer field</td></tr>
<tr><th>HTTP_FIELD_REFRESH </th><td class="description">WHATWG Refresh field</td></tr>
<tr><th>HTTP_FIELD_REPLAY_NONCE </th><td class="description">RFC 8555 (ACME) Replay-Nonce field</td></tr>
<tr><th>HTTP_FIELD_RETRY_AFTER </th><td class="description">Retry-After field</td></tr>
<tr><th>HTTP_FIELD_SCHEDULE_REPLY </th><td class="description">RFC 6638 (CalDAV) Schedule-Reply field</td></tr>
<tr><th>HTTP_FIELD_SCHEDULE_TAG </th><td class="description">RFC 6638 (CalDAV) Schedule-Tag field</td></tr>
<tr><th>HTTP_FIELD_SERVER </th><td class="description">Server field</td></tr>
<tr><th>HTTP_FIELD_STRICT_TRANSPORT_SECURITY </th><td class="description">HSTS Strict-Transport-Security field</td></tr>
<tr><th>HTTP_FIELD_TE </th><td class="description">TE field</td></tr>
<tr><th>HTTP_FIELD_TIMEOUT </th><td class="description">RFC 4918 Timeout field</td></tr>
<tr><th>HTTP_FIELD_TRAILER </th><td class="description">Trailer field</td></tr>
<tr><th>HTTP_FIELD_TRANSFER_ENCODING </th><td class="description">Transfer-Encoding field</td></tr>
<tr><th>HTTP_FIELD_UNKNOWN </th><td class="description">Unknown field</td></tr>
<tr><th>HTTP_FIELD_UPGRADE </th><td class="description">Upgrade field</td></tr>
<tr><th>HTTP_FIELD_USER_AGENT </th><td class="description">User-Agent field</td></tr>
<tr><th>HTTP_FIELD_VARY </th><td class="description">Vary field</td></tr>
<tr><th>HTTP_FIELD_VIA </th><td class="description">Via field</td></tr>
<tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th><td class="description">WWW-Authenticate field</td></tr>
<tr><th>HTTP_FIELD_X_CONTENT_OPTIONS </th><td class="description">WHATWG X-Content-Options field</td></tr>
<tr><th>HTTP_FIELD_X_FRAME_OPTIONS </th><td class="description">WHATWG X-Frame-Options field</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
<p class="description">HTTP keep-alive values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_KEEPALIVE_OFF </th><td class="description">No keep alive support</td></tr>
<tr><th>HTTP_KEEPALIVE_ON </th><td class="description">Use keep alive</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_resolve_e">http_resolve_e</a></h3>
<p class="description"><a href="#httpResolveURI"><code>httpResolveURI</code></a> options bit values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_RESOLVE_DEFAULT </th><td class="description">Resolve with default options</td></tr>
<tr><th>HTTP_RESOLVE_FAXOUT </th><td class="description">Resolve FaxOut service instead of Print</td></tr>
<tr><th>HTTP_RESOLVE_FQDN </th><td class="description">Resolve to a FQDN</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
<p class="description">HTTP state values; states are server-oriented...</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_STATE_CONNECT </th><td class="description">CONNECT command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_COPY </th><td class="description">COPY command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_COPY_SEND </th><td class="description">COPY command, sending data</td></tr>
<tr><th>HTTP_STATE_DELETE </th><td class="description">DELETE command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_DELETE_SEND </th><td class="description">DELETE command, sending data</td></tr>
<tr><th>HTTP_STATE_ERROR </th><td class="description">Error on socket</td></tr>
<tr><th>HTTP_STATE_GET </th><td class="description">GET command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_GET_SEND </th><td class="description">GET command, sending data</td></tr>
<tr><th>HTTP_STATE_HEAD </th><td class="description">HEAD command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_LOCK </th><td class="description">LOCK command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_LOCK_RECV </th><td class="description">LOCK command, receiving data</td></tr>
<tr><th>HTTP_STATE_LOCK_SEND </th><td class="description">LOCK command, sending data</td></tr>
<tr><th>HTTP_STATE_MKCOL </th><td class="description">MKCOL command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_MOVE </th><td class="description">MOVE command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_MOVE_SEND </th><td class="description">MOVE command, sending data</td></tr>
<tr><th>HTTP_STATE_OPTIONS </th><td class="description">OPTIONS command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_POST </th><td class="description">POST command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_POST_RECV </th><td class="description">POST command, receiving data</td></tr>
<tr><th>HTTP_STATE_POST_SEND </th><td class="description">POST command, sending data</td></tr>
<tr><th>HTTP_STATE_PROPFIND </th><td class="description">PROPFIND command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_PROPFIND_RECV </th><td class="description">PROPFIND command, receiving data</td></tr>
<tr><th>HTTP_STATE_PROPFIND_SEND </th><td class="description">PROPFIND command, sending data</td></tr>
<tr><th>HTTP_STATE_PROPPATCH </th><td class="description">PROPPATCH command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_PROPPATCH_RECV </th><td class="description">PROPPATCH command, receiving data</td></tr>
<tr><th>HTTP_STATE_PROPPATCH_SEND </th><td class="description">PROPPATCH command, sending data</td></tr>
<tr><th>HTTP_STATE_PUT </th><td class="description">PUT command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_PUT_RECV </th><td class="description">PUT command, receiving data</td></tr>
<tr><th>HTTP_STATE_STATUS </th><td class="description">Command complete, sending status</td></tr>
<tr><th>HTTP_STATE_TRACE </th><td class="description">TRACE command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_UNKNOWN_METHOD </th><td class="description">Unknown request method, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_UNKNOWN_VERSION </th><td class="description">Unknown request method, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_UNLOCK </th><td class="description">UNLOCK command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_WAITING </th><td class="description">Waiting for command</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
<p class="description">HTTP status codes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_STATUS_ACCEPTED </th><td class="description">DELETE command was successful</td></tr>
<tr><th>HTTP_STATUS_ALREADY_REPORTED </th><td class="description">Already reported (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_BAD_GATEWAY </th><td class="description">Bad gateway</td></tr>
<tr><th>HTTP_STATUS_BAD_REQUEST </th><td class="description">Bad request</td></tr>
<tr><th>HTTP_STATUS_CONFLICT </th><td class="description">Request is self-conflicting</td></tr>
<tr><th>HTTP_STATUS_CONTENT_TOO_LARGE </th><td class="description">Content too large</td></tr>
<tr><th>HTTP_STATUS_CONTINUE </th><td class="description">Everything OK, keep going...</td></tr>
<tr><th>HTTP_STATUS_CREATED </th><td class="description">PUT command was successful</td></tr>
<tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED </th><td class="description">User canceled authorization</td></tr>
<tr><th>HTTP_STATUS_CUPS_PKI_ERROR </th><td class="description">Error negotiating a secure connection</td></tr>
<tr><th>HTTP_STATUS_ERROR </th><td class="description">An error response from httpXxxx()</td></tr>
<tr><th>HTTP_STATUS_EXPECTATION_FAILED </th><td class="description">The expectation given in an Expect header field was not met</td></tr>
<tr><th>HTTP_STATUS_FAILED_DEPENDENCY </th><td class="description">Failed dependency (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_FORBIDDEN </th><td class="description">Forbidden to access this URI</td></tr>
<tr><th>HTTP_STATUS_FOUND </th><td class="description">Document was found at a different URI</td></tr>
<tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th><td class="description">Gateway connection timed out</td></tr>
<tr><th>HTTP_STATUS_GONE </th><td class="description">Server has gone away</td></tr>
<tr><th>HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED </th><td class="description">HTTP version not supported</td></tr>
<tr><th>HTTP_STATUS_INSUFFICIENT_STORAGE </th><td class="description">Insufficient storage (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_LENGTH_REQUIRED </th><td class="description">A content length or encoding is required</td></tr>
<tr><th>HTTP_STATUS_LOCKED </th><td class="description">Locked (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_LOOP_DETECTED </th><td class="description">Loop detected (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th><td class="description">Method is not allowed</td></tr>
<tr><th>HTTP_STATUS_MISDIRECTED_REQUEST </th><td class="description">Misdirected request</td></tr>
<tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th><td class="description">Document has moved permanently</td></tr>
<tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th><td class="description">Multiple files match request</td></tr>
<tr><th>HTTP_STATUS_MULTI_STATUS </th><td class="description">Multiple status codes (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED </th><td class="description">Network Authentication Required (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_NONE </th><td class="description">No Expect value</td></tr>
<tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th><td class="description">Not Acceptable</td></tr>
<tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th><td class="description">Information isn't authoritative</td></tr>
<tr><th>HTTP_STATUS_NOT_FOUND </th><td class="description">URI was not found</td></tr>
<tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th><td class="description">Feature not implemented</td></tr>
<tr><th>HTTP_STATUS_NOT_MODIFIED </th><td class="description">File not modified</td></tr>
<tr><th>HTTP_STATUS_NO_CONTENT </th><td class="description">Successful command, no new data</td></tr>
<tr><th>HTTP_STATUS_OK </th><td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
<tr><th>HTTP_STATUS_PARTIAL_CONTENT </th><td class="description">Only a partial file was received/sent</td></tr>
<tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th><td class="description">Payment required</td></tr>
<tr><th>HTTP_STATUS_PERMANENT_REDIRECT </th><td class="description">Permanent redirection</td></tr>
<tr><th>HTTP_STATUS_PRECONDITION_FAILED </th><td class="description">Precondition failed</td></tr>
<tr><th>HTTP_STATUS_PRECONDITION_REQUIRED </th><td class="description">Precondition required (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED </th><td class="description">Proxy Authentication is Required</td></tr>
<tr><th>HTTP_STATUS_RANGE_NOT_SATISFIABLE </th><td class="description">The requested range is not satisfiable</td></tr>
<tr><th>HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE </th><td class="description">Request Header Fields Too Large (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th><td class="description">Request timed out</td></tr>
<tr><th>HTTP_STATUS_RESET_CONTENT </th><td class="description">Content was reset/recreated</td></tr>
<tr><th>HTTP_STATUS_SEE_OTHER </th><td class="description">See this other link</td></tr>
<tr><th>HTTP_STATUS_SERVER_ERROR </th><td class="description">Internal server error</td></tr>
<tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th><td class="description">Service is unavailable</td></tr>
<tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th><td class="description">HTTP upgrade to TLS/SSL</td></tr>
<tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th><td class="description">Temporary redirection</td></tr>
<tr><th>HTTP_STATUS_TOO_EARLY </th><td class="description">Too early (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_TOO_MANY_REQUESTS </th><td class="description">Too many requests (WebDAV)</td></tr>
<tr><th>HTTP_STATUS_UNAUTHORIZED </th><td class="description">Unauthorized to access host</td></tr>
<tr><th>HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS </th><td class="description">Unavailable For Legal Reasons (RFC 7725)</td></tr>
<tr><th>HTTP_STATUS_UNPROCESSABLE_CONTENT </th><td class="description">Unprocessable content</td></tr>
<tr><th>HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE </th><td class="description">The requested media type is unsupported</td></tr>
<tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th><td class="description">Upgrade to SSL/TLS required</td></tr>
<tr><th>HTTP_STATUS_URI_TOO_LONG </th><td class="description">URI too long</td></tr>
<tr><th>HTTP_STATUS_USE_PROXY </th><td class="description">Must use a proxy to access this URI</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_trust_e">http_trust_e</a></h3>
<p class="description">Level of trust for credentials</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_TRUST_CHANGED </th><td class="description">Credentials have changed</td></tr>
<tr><th>HTTP_TRUST_EXPIRED </th><td class="description">Credentials are expired</td></tr>
<tr><th>HTTP_TRUST_INVALID </th><td class="description">Credentials are invalid</td></tr>
<tr><th>HTTP_TRUST_OK </th><td class="description">Credentials are OK/trusted</td></tr>
<tr><th>HTTP_TRUST_RENEWED </th><td class="description">Credentials have been renewed</td></tr>
<tr><th>HTTP_TRUST_UNKNOWN </th><td class="description">Credentials are unknown/new</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
<p class="description">URI en/decode flags</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_URI_CODING_ALL </th><td class="description">En/decode everything</td></tr>
<tr><th>HTTP_URI_CODING_HOSTNAME </th><td class="description">En/decode the hostname portion</td></tr>
<tr><th>HTTP_URI_CODING_MOST </th><td class="description">En/decode all but the query</td></tr>
<tr><th>HTTP_URI_CODING_NONE </th><td class="description">Don't en/decode anything</td></tr>
<tr><th>HTTP_URI_CODING_QUERY </th><td class="description">En/decode the query portion</td></tr>
<tr><th>HTTP_URI_CODING_RESOURCE </th><td class="description">En/decode the resource portion</td></tr>
<tr><th>HTTP_URI_CODING_RFC6874 </th><td class="description">Use RFC 6874 address format</td></tr>
<tr><th>HTTP_URI_CODING_USERNAME </th><td class="description">En/decode the username portion</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_uri_status_e">http_uri_status_e</a></h3>
<p class="description">URI separation status</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th><td class="description">Bad arguments to function (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th><td class="description">Bad hostname in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_PORT </th><td class="description">Bad port number in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th><td class="description">Bad resource in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_SCHEME </th><td class="description">Bad scheme in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_URI </th><td class="description">Bad/empty URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_USERNAME </th><td class="description">Bad username in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th><td class="description">Missing resource in URI (warning)</td></tr>
<tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th><td class="description">Missing scheme in URI (warning)</td></tr>
<tr><th>HTTP_URI_STATUS_OK </th><td class="description">URI decoded OK</td></tr>
<tr><th>HTTP_URI_STATUS_OVERFLOW </th><td class="description">URI buffer for httpAssembleURI is too small</td></tr>
<tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th><td class="description">Unknown scheme in URI (warning)</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_dstate_e">ipp_dstate_e</a></h3>
<p class="description">&quot;document-state&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_DSTATE_ABORTED </th><td class="description">Document is aborted</td></tr>
<tr><th>IPP_DSTATE_CANCELED </th><td class="description">Document is canceled</td></tr>
<tr><th>IPP_DSTATE_COMPLETED </th><td class="description">Document is completed</td></tr>
<tr><th>IPP_DSTATE_PENDING </th><td class="description">Document is pending</td></tr>
<tr><th>IPP_DSTATE_PROCESSING </th><td class="description">Document is processing</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
<p class="description">&quot;finishings&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_FINISHINGS_BALE </th><td class="description">Bale (any type)</td></tr>
<tr><th>IPP_FINISHINGS_BIND </th><td class="description">Bind</td></tr>
<tr><th>IPP_FINISHINGS_BIND_BOTTOM </th><td class="description">Bind on bottom</td></tr>
<tr><th>IPP_FINISHINGS_BIND_LEFT </th><td class="description">Bind on left</td></tr>
<tr><th>IPP_FINISHINGS_BIND_RIGHT </th><td class="description">Bind on right</td></tr>
<tr><th>IPP_FINISHINGS_BIND_TOP </th><td class="description">Bind on top</td></tr>
<tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th><td class="description">Fold to make booklet</td></tr>
<tr><th>IPP_FINISHINGS_COAT </th><td class="description">Apply protective liquid or powder coating</td></tr>
<tr><th>IPP_FINISHINGS_COVER </th><td class="description">Add cover</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_ACCORDION </th><td class="description">Accordion-fold the paper vertically into four sections</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_HALF </th><td class="description">Fold the paper in half vertically</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_HALF_Z </th><td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE </th><td class="description">Fold the top quarter of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_LETTER </th><td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_PARALLEL </th><td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_POSTER </th><td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE </th><td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_FOLD_Z </th><td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT </th><td class="description">Punch 1 hole bottom left</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT </th><td class="description">Punch 1 hole bottom right</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM </th><td class="description">Punch 2 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT </th><td class="description">Punch 2 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT </th><td class="description">Punch 2 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP </th><td class="description">Punch 2 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM </th><td class="description">Punch 4 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT </th><td class="description">Punch 4 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT </th><td class="description">Punch 4 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP </th><td class="description">Punch 4 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT </th><td class="description">Punch 1 hole top left</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT </th><td class="description">Punch 1 hole top right</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM </th><td class="description">Punch 3 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT </th><td class="description">Punch 3 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT </th><td class="description">Punch 3 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP </th><td class="description">Punch 3 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH </th><td class="description">Stitch along any side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th><td class="description">Stitch along bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th><td class="description">Stitch along left side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th><td class="description">Stitch along right side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th><td class="description">Stitch along top edge</td></tr>
<tr><th>IPP_FINISHINGS_FOLD </th><td class="description">Fold (any type)</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_ACCORDION </th><td class="description">Accordion-fold the paper vertically into four sections</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th><td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_HALF </th><td class="description">Fold the paper in half vertically</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_HALF_Z </th><td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th><td class="description">Fold the top quarter of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_LETTER </th><td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th><td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_POSTER </th><td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th><td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_Z </th><td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
<tr><th>IPP_FINISHINGS_JOG_OFFSET </th><td class="description">Offset for binding (any type)</td></tr>
<tr><th>IPP_FINISHINGS_LAMINATE </th><td class="description">Apply protective (solid) material</td></tr>
<tr><th>IPP_FINISHINGS_NONE </th><td class="description">No finishing</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH </th><td class="description">Punch (any location/count)</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th><td class="description">Punch 1 hole bottom left</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th><td class="description">Punch 1 hole bottom right</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th><td class="description">Punch 2 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th><td class="description">Punch 2 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th><td class="description">Punch 2 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th><td class="description">Punch 2 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th><td class="description">Punch multiple holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th><td class="description">Punch multiple holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th><td class="description">Punch multiple holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th><td class="description">Punch multiple holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th><td class="description">Punch 4 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th><td class="description">Punch 4 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th><td class="description">Punch 4 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th><td class="description">Punch 4 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th><td class="description">Punch 1 hole top left</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th><td class="description">Punch 1 hole top right</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th><td class="description">Punch 3 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th><td class="description">Punch 3 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th><td class="description">Punch 3 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th><td class="description">Punch 3 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_SADDLE_STITCH </th><td class="description">Staple interior</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE </th><td class="description">Staple (any location/method)</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th><td class="description">Staple bottom left corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th><td class="description">Staple bottom right corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th><td class="description">Two staples on bottom</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th><td class="description">Two staples on left</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th><td class="description">Two staples on right</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th><td class="description">Two staples on top</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th><td class="description">Staple top left corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th><td class="description">Staple top right corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th><td class="description">Three staples on bottom</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th><td class="description">Three staples on left</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th><td class="description">Three staples on right</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th><td class="description">Three staples on top</td></tr>
<tr><th>IPP_FINISHINGS_TRIM </th><td class="description">Trim (any type)</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th><td class="description">Trim output after each copy</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th><td class="description">Trim output after each document</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th><td class="description">Trim output after job</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th><td class="description">Trim output after each page</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
<p class="description">&quot;job-state&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_JSTATE_ABORTED </th><td class="description">Job has aborted due to error</td></tr>
<tr><th>IPP_JSTATE_CANCELED </th><td class="description">Job has been canceled</td></tr>
<tr><th>IPP_JSTATE_COMPLETED </th><td class="description">Job has completed successfully</td></tr>
<tr><th>IPP_JSTATE_HELD </th><td class="description">Job is held for printing</td></tr>
<tr><th>IPP_JSTATE_PENDING </th><td class="description">Job is waiting to be printed</td></tr>
<tr><th>IPP_JSTATE_PROCESSING </th><td class="description">Job is currently printing</td></tr>
<tr><th>IPP_JSTATE_STOPPED </th><td class="description">Job has been stopped</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
<p class="description">IPP operations</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_OP_ACKNOWLEDGE_DOCUMENT </th><td class="description">Acknowledge-Document: Acknowledge processing of a document</td></tr>
<tr><th>IPP_OP_ACKNOWLEDGE_ENCRYPTED_JOB_ATTRIBUTES </th><td class="description">Acknowledge-Encrypted-Job-Attributes: Acknowledge receipt of encrypted job attributes</td></tr>
<tr><th>IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER </th><td class="description">Acknowledge-Identify-Printer: Acknowledge action on an Identify-Printer request</td></tr>
<tr><th>IPP_OP_ACKNOWLEDGE_JOB </th><td class="description">Acknowledge-Job: Acknowledge processing of a job</td></tr>
<tr><th>IPP_OP_ACTIVATE_PRINTER <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Activate-Printer: Start a printer and accept jobs </td></tr>
<tr><th>IPP_OP_ADD_DOCUMENT_IMAGES </th><td class="description">Add-Document-Images: Add image(s) from the specified scanner source</td></tr>
<tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th><td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr>
<tr><th>IPP_OP_CANCEL_CURRENT_JOB </th><td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
<tr><th>IPP_OP_CANCEL_DOCUMENT </th><td class="description">Cancel-Document: Cancel a document</td></tr>
<tr><th>IPP_OP_CANCEL_JOB </th><td class="description">Cancel-Job: Cancel a job</td></tr>
<tr><th>IPP_OP_CANCEL_JOBS </th><td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
<tr><th>IPP_OP_CANCEL_MY_JOBS </th><td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
<tr><th>IPP_OP_CANCEL_RESOURCE </th><td class="description">Cancel-Resource: Uninstall a resource.</td></tr>
<tr><th>IPP_OP_CANCEL_SUBSCRIPTION </th><td class="description">Cancel-Subscription: Cancel a subscription</td></tr>
<tr><th>IPP_OP_CLOSE_JOB </th><td class="description">Close-Job: Close a job and start printing</td></tr>
<tr><th>IPP_OP_CREATE_JOB </th><td class="description">Create-Job: Create an empty print job</td></tr>
<tr><th>IPP_OP_CREATE_JOB_SUBSCRIPTIONS </th><td class="description">Create-Job-Subscriptions: Create one of more job subscriptions</td></tr>
<tr><th>IPP_OP_CREATE_PRINTER </th><td class="description">Create-Printer: Create a new service.</td></tr>
<tr><th>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS </th><td class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions</td></tr>
<tr><th>IPP_OP_CREATE_RESOURCE </th><td class="description">Create-Resource: Create a new (empty) resource.</td></tr>
<tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th><td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr>
<tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th><td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr>
<tr><th>IPP_OP_CUPS_ACCEPT_JOBS <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Accept-Jobs: Accept new jobs on a printer </td></tr>
<tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th><td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
<tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th><td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
<tr><th>IPP_OP_CUPS_AUTHENTICATE_JOB </th><td class="description">CUPS-Authenticate-Job: Authenticate a job</td></tr>
<tr><th>IPP_OP_CUPS_CREATE_LOCAL_PRINTER </th><td class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer</td></tr>
<tr><th>IPP_OP_CUPS_DELETE_CLASS </th><td class="description">CUPS-Delete-Class: Delete a class</td></tr>
<tr><th>IPP_OP_CUPS_DELETE_PRINTER </th><td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
<tr><th>IPP_OP_CUPS_GET_CLASSES <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Get-Classes: Get a list of classes </td></tr>
<tr><th>IPP_OP_CUPS_GET_DEFAULT </th><td class="description">CUPS-Get-Default: Get the default printer</td></tr>
<tr><th>IPP_OP_CUPS_GET_DEVICES <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Get-Devices: Get a list of supported devices </td></tr>
<tr><th>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Get-Document: Get a document file </td></tr>
<tr><th>IPP_OP_CUPS_GET_PPD <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Get-PPD: Get a PPD file </td></tr>
<tr><th>IPP_OP_CUPS_GET_PPDS <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Get-PPDs: Get a list of supported drivers </td></tr>
<tr><th>IPP_OP_CUPS_GET_PRINTERS </th><td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
<tr><th>IPP_OP_CUPS_INVALID </th><td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
<tr><th>IPP_OP_CUPS_MOVE_JOB </th><td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
<tr><th>IPP_OP_CUPS_REJECT_JOBS <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">CUPS-Reject-Jobs: Reject new jobs on a printer </td></tr>
<tr><th>IPP_OP_CUPS_SET_DEFAULT </th><td class="description">CUPS-Set-Default: Set the default printer</td></tr>
<tr><th>IPP_OP_DEACTIVATE_PRINTER <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Deactivate-Printer: Stop a printer and do not accept jobs </td></tr>
<tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th><td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr>
<tr><th>IPP_OP_DELETE_DOCUMENT <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Delete-Document: Delete a document </td></tr>
<tr><th>IPP_OP_DELETE_PRINTER </th><td class="description">Delete-Printer: Delete an existing service.</td></tr>
<tr><th>IPP_OP_DEREGISTER_OUTPUT_DEVICE </th><td class="description">Deregister-Output-Device: Remove an output device</td></tr>
<tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th><td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr>
<tr><th>IPP_OP_DISABLE_PRINTER </th><td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
<tr><th>IPP_OP_ENABLE_ALL_PRINTERS </th><td class="description">Enable-All-Printers: Start accepting new jobs on all services.</td></tr>
<tr><th>IPP_OP_ENABLE_PRINTER </th><td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
<tr><th>IPP_OP_FETCH_DOCUMENT </th><td class="description">Fetch-Document: Fetch a document for processing</td></tr>
<tr><th>IPP_OP_FETCH_ENCRYPTED_JOB_ATTRIBUTES </th><td class="description">Fetch-Encrypted-Job-Attributes: Download encrypted job attributes</td></tr>
<tr><th>IPP_OP_FETCH_JOB </th><td class="description">Fetch-Job: Fetch a job for processing</td></tr>
<tr><th>IPP_OP_GET_DOCUMENTS </th><td class="description">Get-Documents: Get a list of documents in a job</td></tr>
<tr><th>IPP_OP_GET_DOCUMENT_ATTRIBUTES </th><td class="description">Get-Document-Attributes: Get document information</td></tr>
<tr><th>IPP_OP_GET_ENCRYPTED_JOB_ATTRIBUTES </th><td class="description">Get-Encrypted-Job-Attributes: Query job attributes and return in an encrypted form</td></tr>
<tr><th>IPP_OP_GET_JOBS </th><td class="description">Get-Jobs: Get a list of jobs</td></tr>
<tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th><td class="description">Get-Job-Attribute: Get information about a job</td></tr>
<tr><th>IPP_OP_GET_NEXT_DOCUMENT_DATA </th><td class="description">Get-Next-Document-Data: Scan more document data</td></tr>
<tr><th>IPP_OP_GET_NOTIFICATIONS </th><td class="description">Get-Notifications: Get notification events</td></tr>
<tr><th>IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES </th><td class="description">Get-Output-Device-Attributes: Get printer information for a specific output device</td></tr>
<tr><th>IPP_OP_GET_PRINTERS </th><td class="description">Get-Printers: Get a list of services.</td></tr>
<tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th><td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
<tr><th>IPP_OP_GET_PRINTER_RESOURCES </th><td class="description">Get-Printer-Resources: Get a list of resources for a printer</td></tr>
<tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th><td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
<tr><th>IPP_OP_GET_PRINT_SUPPORT_FILES <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Get-Printer-Support-Files: Get printer support files </td></tr>
<tr><th>IPP_OP_GET_RESOURCES </th><td class="description">Get-Resources: Get list of resources</td></tr>
<tr><th>IPP_OP_GET_RESOURCE_ATTRIBUTES </th><td class="description">Get-Resource-Attributes: Get resource information</td></tr>
<tr><th>IPP_OP_GET_RESOURCE_DATA <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Get-Resource-Data: Get resource data </td></tr>
<tr><th>IPP_OP_GET_SUBSCRIPTIONS </th><td class="description">Get-Subscriptions: Get list of subscriptions</td></tr>
<tr><th>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES </th><td class="description">Get-Subscription-Attributes: Get subscription information</td></tr>
<tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th><td class="description">Get-System-Attributes: Get system object attributes.</td></tr>
<tr><th>IPP_OP_GET_SYSTEM_SUPPORTED_VALUES </th><td class="description">Get-System-Supported-Values: Get supported values for system object attributes.</td></tr>
<tr><th>IPP_OP_GET_USER_PRINTER_ATTRIBUTES </th><td class="description">Get-User-Printer-Attributes: Get printer capabilities with authentication</td></tr>
<tr><th>IPP_OP_HOLD_JOB </th><td class="description">Hold-Job: Hold a job for printing</td></tr>
<tr><th>IPP_OP_HOLD_NEW_JOBS </th><td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
<tr><th>IPP_OP_IDENTIFY_PRINTER </th><td class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</td></tr>
<tr><th>IPP_OP_INSTALL_RESOURCE </th><td class="description">Install-Resource: Install a resource.</td></tr>
<tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th><td class="description">Pause-All-Printers: Stop all services immediately.</td></tr>
<tr><th>IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB </th><td class="description">Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs.</td></tr>
<tr><th>IPP_OP_PAUSE_PRINTER </th><td class="description">Pause-Printer: Stop a printer</td></tr>
<tr><th>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </th><td class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</td></tr>
<tr><th>IPP_OP_PRINT_JOB </th><td class="description">Print-Job: Print a single file</td></tr>
<tr><th>IPP_OP_PRINT_URI <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Print-URI: Print a single URL </td></tr>
<tr><th>IPP_OP_PROMOTE_JOB </th><td class="description">Promote-Job: Promote a job to print sooner</td></tr>
<tr><th>IPP_OP_PURGE_JOBS <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Purge-Jobs: Delete all jobs </td></tr>
<tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th><td class="description">Register-Output-Device: Register a remote service.</td></tr>
<tr><th>IPP_OP_RELEASE_HELD_NEW_JOBS </th><td class="description">Release-Held-New-Jobs: Release new jobs that were previously held</td></tr>
<tr><th>IPP_OP_RELEASE_JOB </th><td class="description">Release-Job: Release a job for printing</td></tr>
<tr><th>IPP_OP_RENEW_SUBSCRIPTION </th><td class="description">Renew-Subscription: Renew a printer subscription</td></tr>
<tr><th>IPP_OP_REPROCESS_JOB <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Reprocess-Job: Reprint a job </td></tr>
<tr><th>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Restart-Job: Reprint a job </td></tr>
<tr><th>IPP_OP_RESTART_ONE_PRINTER </th><td class="description">Restart-One-Printer: Restart a single printer/service</td></tr>
<tr><th>IPP_OP_RESTART_PRINTER </th><td class="description">Restart-Printer: Restart a printer</td></tr>
<tr><th>IPP_OP_RESTART_SYSTEM </th><td class="description">Restart-System: Restart all services.</td></tr>
<tr><th>IPP_OP_RESUBMIT_JOB </th><td class="description">Resubmit-Job: Copy and reprint a job</td></tr>
<tr><th>IPP_OP_RESUME_ALL_PRINTERS </th><td class="description">Resume-All-Printers: Start job processing on all services.</td></tr>
<tr><th>IPP_OP_RESUME_JOB </th><td class="description">Resume-Job: Resume the current job</td></tr>
<tr><th>IPP_OP_RESUME_PRINTER </th><td class="description">Resume-Printer: Start a printer</td></tr>
<tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th><td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
<tr><th>IPP_OP_SEND_DOCUMENT </th><td class="description">Send-Document: Add a file to a job</td></tr>
<tr><th>IPP_OP_SEND_NOTIFICATIONS </th><td class="description">Send-Notifications: Send notification events</td></tr>
<tr><th>IPP_OP_SEND_RESOURCE_DATA </th><td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr>
<tr><th>IPP_OP_SEND_URI <span class="info">&#160;DEPRECATED&#160;</span></th><td class="description">Send-URI: Add a URL to a job </td></tr>
<tr><th>IPP_OP_SET_DOCUMENT_ATTRIBUTES </th><td class="description">Set-Document-Attributes: Set document values</td></tr>
<tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th><td class="description">Set-Job-Attributes: Set job values</td></tr>
<tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th><td class="description">Set-Printer-Attributes: Set printer values</td></tr>
<tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th><td class="description">Set-Resource-Attributes: Set resource object  attributes.</td></tr>
<tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th><td class="description">Set-System-Attributes: Set system object attributes.</td></tr>
<tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th><td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr>
<tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th><td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr>
<tr><th>IPP_OP_SHUTDOWN_PRINTER </th><td class="description">Shutdown-Printer: Turn a printer off</td></tr>
<tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th><td class="description">Startup-All-Printers: Startup all services.</td></tr>
<tr><th>IPP_OP_STARTUP_ONE_PRINTER </th><td class="description">Startup-One-Printer: Start a service.</td></tr>
<tr><th>IPP_OP_STARTUP_PRINTER </th><td class="description">Startup-Printer: Turn a printer on</td></tr>
<tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th><td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
<tr><th>IPP_OP_UPDATE_ACTIVE_JOBS </th><td class="description">Update-Active-Jobs: Update the list of active jobs that a proxy has processed</td></tr>
<tr><th>IPP_OP_UPDATE_DOCUMENT_STATUS </th><td class="description">Update-Document-Status: Update document values</td></tr>
<tr><th>IPP_OP_UPDATE_JOB_STATUS </th><td class="description">Update-Job-Status: Update job values</td></tr>
<tr><th>IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES </th><td class="description">Update-Output-Device-Attributes: Update output device values</td></tr>
<tr><th>IPP_OP_VALIDATE_DOCUMENT </th><td class="description">Validate-Document: Validate document values prior to submission</td></tr>
<tr><th>IPP_OP_VALIDATE_JOB </th><td class="description">Validate-Job: Validate job values prior to submission</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
<p class="description">&quot;orientation-requested&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_ORIENT_LANDSCAPE </th><td class="description">90 degrees counter-clockwise</td></tr>
<tr><th>IPP_ORIENT_NONE </th><td class="description">No rotation</td></tr>
<tr><th>IPP_ORIENT_PORTRAIT </th><td class="description">No rotation</td></tr>
<tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th><td class="description">90 degrees clockwise</td></tr>
<tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th><td class="description">180 degrees</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
<p class="description">&quot;printer-state&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_PSTATE_IDLE </th><td class="description">Printer is idle</td></tr>
<tr><th>IPP_PSTATE_PROCESSING </th><td class="description">Printer is working</td></tr>
<tr><th>IPP_PSTATE_STOPPED </th><td class="description">Printer is stopped</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
<p class="description">&quot;print-quality&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_QUALITY_DRAFT </th><td class="description">Draft quality</td></tr>
<tr><th>IPP_QUALITY_HIGH </th><td class="description">High quality</td></tr>
<tr><th>IPP_QUALITY_NORMAL </th><td class="description">Normal quality</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
<p class="description">Resolution units</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_RES_PER_CM </th><td class="description">Pixels per centimeter</td></tr>
<tr><th>IPP_RES_PER_INCH </th><td class="description">Pixels per inch</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_rstate_e">ipp_rstate_e</a></h3>
<p class="description">&quot;resource-state&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_RSTATE_ABORTED </th><td class="description">Resource has been aborted and is pending deletion.</td></tr>
<tr><th>IPP_RSTATE_AVAILABLE </th><td class="description">Resource is available for installation.</td></tr>
<tr><th>IPP_RSTATE_CANCELED </th><td class="description">Resource has been canceled and is pending deletion.</td></tr>
<tr><th>IPP_RSTATE_INSTALLED </th><td class="description">Resource is installed.</td></tr>
<tr><th>IPP_RSTATE_PENDING </th><td class="description">Resource is created but has no data yet.</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_sstate_e">ipp_sstate_e</a></h3>
<p class="description">&quot;system-state&quot; values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_SSTATE_IDLE </th><td class="description">At least one printer is idle and none are processing a job.</td></tr>
<tr><th>IPP_SSTATE_PROCESSING </th><td class="description">At least one printer is processing a job.</td></tr>
<tr><th>IPP_SSTATE_STOPPED </th><td class="description">All printers are stopped.</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
<p class="description"><code>ipp_t</code> state values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_STATE_ATTRIBUTE </th><td class="description">One or more attributes need to be sent/received</td></tr>
<tr><th>IPP_STATE_DATA </th><td class="description">IPP request data needs to be sent/received</td></tr>
<tr><th>IPP_STATE_ERROR </th><td class="description">An error occurred</td></tr>
<tr><th>IPP_STATE_HEADER </th><td class="description">The request header needs to be sent/received</td></tr>
<tr><th>IPP_STATE_IDLE </th><td class="description">Nothing is happening/request completed</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
<p class="description">IPP status code values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_STATUS_CUPS_INVALID </th><td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th><td class="description">client-error-account-authorization-failed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th><td class="description">client-error-account-closed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th><td class="description">client-error-account-info-needed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th><td class="description">client-error-account-limit-reached</td></tr>
<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th><td class="description">client-error-attributes-not-settable</td></tr>
<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th><td class="description">client-error-attributes-or-values-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th><td class="description">client-error-bad-request</td></tr>
<tr><th>IPP_STATUS_ERROR_BUSY </th><td class="description">server-error-busy</td></tr>
<tr><th>IPP_STATUS_ERROR_CHARSET </th><td class="description">client-error-charset-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th><td class="description">client-error-compression-error</td></tr>
<tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th><td class="description">client-error-compression-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_CONFLICTING </th><td class="description">client-error-conflicting-attributes</td></tr>
<tr><th>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED </th><td class="description">cups-authentication-canceled - Authentication canceled by user</td></tr>
<tr><th>IPP_STATUS_ERROR_CUPS_OAUTH </th><td class="description">cups-oauth - OAuth error</td></tr>
<tr><th>IPP_STATUS_ERROR_CUPS_PKI </th><td class="description">cups-pki-error - Error negotiating a secure connection</td></tr>
<tr><th>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED </th><td class="description">cups-upgrade-required - TLS upgrade required</td></tr>
<tr><th>IPP_STATUS_ERROR_DEVICE </th><td class="description">server-error-device-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th><td class="description">client-error-document-access-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th><td class="description">client-error-document-format-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th><td class="description">client-error-document-format-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th><td class="description">client-error-document-password-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th><td class="description">client-error-document-permission-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th><td class="description">client-error-document-security-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th><td class="description">client-error-document-unprintable-error</td></tr>
<tr><th>IPP_STATUS_ERROR_FORBIDDEN </th><td class="description">client-error-forbidden</td></tr>
<tr><th>IPP_STATUS_ERROR_GONE </th><td class="description">client-error-gone</td></tr>
<tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th><td class="description">client-error-ignored-all-subscriptions</td></tr>
<tr><th>IPP_STATUS_ERROR_INTERNAL </th><td class="description">server-error-internal-error</td></tr>
<tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th><td class="description">server-error-job-canceled</td></tr>
<tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th><td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th><td class="description">server-error-not-accepting-jobs</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th><td class="description">client-error-not-authenticated</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th><td class="description">client-error-not-authorized</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th><td class="description">client-error-not-fetchable</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_FOUND </th><td class="description">client-error-not-found</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th><td class="description">client-error-not-possible</td></tr>
<tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th><td class="description">server-error-operation-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th><td class="description">server-error-printer-is-deactivated</td></tr>
<tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th><td class="description">client-error-request-entity-too-large</td></tr>
<tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th><td class="description">client-error-request-value-too-long</td></tr>
<tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th><td class="description">server-error-service-unavailable</td></tr>
<tr><th>IPP_STATUS_ERROR_TEMPORARY </th><td class="description">server-error-temporary-error</td></tr>
<tr><th>IPP_STATUS_ERROR_TIMEOUT </th><td class="description">client-error-timeout</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th><td class="description">server-error-too-many-documents</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th><td class="description">server-error-too-many-jobs</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th><td class="description">client-error-too-many-subscriptions</td></tr>
<tr><th>IPP_STATUS_ERROR_URI_SCHEME </th><td class="description">client-error-uri-scheme-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th><td class="description">server-error-version-not-supported</td></tr>
<tr><th>IPP_STATUS_OK </th><td class="description">successful-ok</td></tr>
<tr><th>IPP_STATUS_OK_CONFLICTING </th><td class="description">successful-ok-conflicting-attributes</td></tr>
<tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th><td class="description">successful-ok-events-complete</td></tr>
<tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th><td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
<tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th><td class="description">successful-ok-ignored-subscriptions</td></tr>
<tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th><td class="description">successful-ok-too-many-events</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
<p class="description">Value and group tag values for attributes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_TAG_ADMINDEFINE </th><td class="description">Admin-defined value</td></tr>
<tr><th>IPP_TAG_BEGIN_COLLECTION </th><td class="description">Beginning of collection value</td></tr>
<tr><th>IPP_TAG_BOOLEAN </th><td class="description">Boolean value</td></tr>
<tr><th>IPP_TAG_CHARSET </th><td class="description">Character set value</td></tr>
<tr><th>IPP_TAG_CUPS_CONST </th><td class="description">Bitflag for copied/const attribute values</td></tr>
<tr><th>IPP_TAG_CUPS_INVALID </th><td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
<tr><th>IPP_TAG_CUPS_MASK </th><td class="description">Mask for copied attribute values</td></tr>
<tr><th>IPP_TAG_DATE </th><td class="description">Date/time value</td></tr>
<tr><th>IPP_TAG_DEFAULT </th><td class="description">Default value</td></tr>
<tr><th>IPP_TAG_DELETEATTR </th><td class="description">Delete-attribute value</td></tr>
<tr><th>IPP_TAG_DOCUMENT </th><td class="description">Document group</td></tr>
<tr><th>IPP_TAG_END </th><td class="description">End-of-attributes</td></tr>
<tr><th>IPP_TAG_END_COLLECTION </th><td class="description">End of collection value</td></tr>
<tr><th>IPP_TAG_ENUM </th><td class="description">Enumeration value</td></tr>
<tr><th>IPP_TAG_EVENT_NOTIFICATION </th><td class="description">Event group</td></tr>
<tr><th>IPP_TAG_EXTENSION </th><td class="description">Extension point for 32-bit tags (part of value)</td></tr>
<tr><th>IPP_TAG_INTEGER </th><td class="description">Integer value</td></tr>
<tr><th>IPP_TAG_JOB </th><td class="description">Job group</td></tr>
<tr><th>IPP_TAG_KEYWORD </th><td class="description">Keyword value</td></tr>
<tr><th>IPP_TAG_LANGUAGE </th><td class="description">Language value</td></tr>
<tr><th>IPP_TAG_MEMBERNAME </th><td class="description">Collection member name value</td></tr>
<tr><th>IPP_TAG_MIMETYPE </th><td class="description">MIME media type value</td></tr>
<tr><th>IPP_TAG_NAME </th><td class="description">Name value</td></tr>
<tr><th>IPP_TAG_NAMELANG </th><td class="description">Name-with-language value</td></tr>
<tr><th>IPP_TAG_NOTSETTABLE </th><td class="description">Not-settable value</td></tr>
<tr><th>IPP_TAG_NOVALUE </th><td class="description">No-value value</td></tr>
<tr><th>IPP_TAG_OPERATION </th><td class="description">Operation group</td></tr>
<tr><th>IPP_TAG_PRINTER </th><td class="description">Printer group</td></tr>
<tr><th>IPP_TAG_RANGE </th><td class="description">Range value</td></tr>
<tr><th>IPP_TAG_RESOLUTION </th><td class="description">Resolution value</td></tr>
<tr><th>IPP_TAG_RESOURCE </th><td class="description">Resource group</td></tr>
<tr><th>IPP_TAG_STRING </th><td class="description">Octet string value</td></tr>
<tr><th>IPP_TAG_SUBSCRIPTION </th><td class="description">Subscription group</td></tr>
<tr><th>IPP_TAG_SYSTEM </th><td class="description">System group</td></tr>
<tr><th>IPP_TAG_TEXT </th><td class="description">Text value</td></tr>
<tr><th>IPP_TAG_TEXTLANG </th><td class="description">Text-with-language value</td></tr>
<tr><th>IPP_TAG_UNKNOWN </th><td class="description">Unknown value</td></tr>
<tr><th>IPP_TAG_UNSUPPORTED_GROUP </th><td class="description">Unsupported attributes group</td></tr>
<tr><th>IPP_TAG_UNSUPPORTED_VALUE </th><td class="description">Unsupported value</td></tr>
<tr><th>IPP_TAG_URI </th><td class="description">URI value</td></tr>
<tr><th>IPP_TAG_URISCHEME </th><td class="description">URI scheme value</td></tr>
<tr><th>IPP_TAG_ZERO </th><td class="description">Zero tag - used for separators</td></tr>
</tbody></table>
</div>
</body>
</html>
